feat(project): add Excel font controls and reflow

This commit is contained in:
2026-10-03 05:47:57 +09:00
parent 494d84f7c2
commit dc2008c5b3
13 changed files with 146 additions and 42 deletions
+17
View File
@@ -27,6 +27,23 @@ class GoalRichTextTests(unittest.TestCase):
assert store.merge_goal_texts(['a', 'b']) == 'a\nb'
assert store.validate_goal_text(rich([{"text": " "}])) == ''
def test_italic_and_underline_survive_save_render_and_merge(self):
body = rich([{"text": "<선택>", "italic": True, "underline": True, "size": 16},
{"text": "해제", "italic": False, "underline": False},
{"text": "invalid", "italic": "url(javascript:x)", "underline": 1}])
stored = store.validate_goal_text(body)
runs = store.goal_text_runs(stored)
assert runs[0]["italic"] is True and runs[0]["underline"] is True
assert runs[1]["italic"] is False and runs[1]["underline"] is False
assert runs[2] == {"text": "invalid"}
html = store.goal_text_html(stored)
assert '&lt;선택&gt;' in html and 'font-style:italic' in html and 'text-decoration:underline' in html
assert 'font-style:normal' in html and 'text-decoration:none' in html
assert 'javascript' not in stored
merged = store.merge_goal_texts([stored, 'plain'])
assert store.goal_text_runs(merged)[0]["underline"] is True
assert store.goal_text_plain(merged) == '<선택>해제invalid\nplain'
def test_rich_payload_limits_and_malformed_data(self):
with self.assertRaises(ValueError):