fix(project): retain monthly plan text styles

This commit is contained in:
2026-10-04 13:30:36 +09:00
parent ed7da57066
commit 86622cc4dd
7 changed files with 50 additions and 10 deletions
+4 -3
View File
@@ -535,8 +535,9 @@ def goal_text_plain(body: Any) -> str:
return "".join(r["text"] for r in goal_text_runs(body))
def goal_text_html(body: Any) -> str:
"""허용한 글자 서식만 HTML로 만든다. 사용자 텍스트는 항상 escape한다."""
def goal_text_html(body: Any, *, include_size: bool = True) -> str:
"""허용한 글자 서식만 HTML로 만든다. 사용자 텍스트는 항상 escape한다.
월간 계획 요약에서는 include_size=False로 글자 크기만 화면 기본값을 사용한다."""
out = []
for run in goal_text_runs(body):
style = []
@@ -548,7 +549,7 @@ def goal_text_html(body: Any) -> str:
style.append("text-decoration:" + ("underline" if run["underline"] else "none"))
if "color" in run:
style.append("color:" + run["color"])
if "size" in run:
if include_size and "size" in run:
style.append(f'font-size:{run["size"]}px')
text = escape(run["text"])
out.append(f'<span style="{";".join(style)}">{text}</span>' if style else text)