feat(프로젝트): 설명란 하이퍼링크 글자 크기·굵기 변경
- 링크는 한 글자처럼 잠겨(contenteditable=false) execCommand 서식이 안 들어갔다 - 고른 범위의 링크는 링크 안쪽 span style 로 크기(글자 크기 도구)·굵기(굵게 버튼·Ctrl+B) - 링크 기본이 굵게라 보통 = font-weight: 400, 서버 desc_inline_style 이 400 만 허용 - 글자와 같이 고르면 글자에 적용된 굵기를 따름 - project.js 캐시 버전 20261030b, 브라우저·sanitize 테스트 추가 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,13 @@ class DescStyleTests(unittest.TestCase):
|
||||
out = self.clean('<span style="color: rgb(224, 62, 62); font-size: 22px">a</span><span style="color:#ABC">b</span>')
|
||||
self.assertEqual(out, '<span style="color: rgb(224, 62, 62); font-size: 22px">a</span><span style="color: #abc">b</span>')
|
||||
|
||||
def test_link_inner_size_and_normal_weight_kept(self):
|
||||
# 링크 서식(2026-10-30) — 링크 안쪽 span 의 크기·굵기 "보통"(400)만, 다른 굵기는 버림
|
||||
out = self.clean('<a href="https://x.y"><span style="font-size: 18px; font-weight: 400">l</span></a>'
|
||||
'<span style="font-weight: normal">a</span><span style="font-weight: 900">b</span>')
|
||||
self.assertEqual(out, '<a href="https://x.y"><span style="font-size: 18px; font-weight: 400">l</span></a>'
|
||||
'<span style="font-weight: 400">a</span><span>b</span>')
|
||||
|
||||
def test_other_declarations_and_sizes_dropped(self):
|
||||
out = self.clean('<span style="background:url(javascript:x); font-size: 99px; color: red; position:fixed">a</span>')
|
||||
self.assertEqual(out, "<span>a</span>")
|
||||
|
||||
Reference in New Issue
Block a user