feat(project): add Excel font controls and reflow
This commit is contained in:
@@ -504,8 +504,9 @@ def goal_text_runs(body: Any, *, strict: bool = False) -> list[dict[str, Any]]:
|
||||
if not isinstance(item, dict) or not isinstance(item.get("text"), str):
|
||||
raise ValueError("서식 데이터가 올바르지 않습니다.")
|
||||
run: dict[str, Any] = {"text": item["text"]}
|
||||
if isinstance(item.get("bold"), bool):
|
||||
run["bold"] = item["bold"]
|
||||
for key in ("bold", "italic", "underline"):
|
||||
if isinstance(item.get(key), bool):
|
||||
run[key] = item[key]
|
||||
if re.fullmatch(r"#[0-9a-fA-F]{6}", str(item.get("color", ""))):
|
||||
run["color"] = item["color"].lower()
|
||||
size = item.get("size")
|
||||
@@ -533,6 +534,10 @@ def goal_text_html(body: Any) -> str:
|
||||
style = []
|
||||
if "bold" in run:
|
||||
style.append("font-weight:" + ("700" if run["bold"] else "400"))
|
||||
if "italic" in run:
|
||||
style.append("font-style:" + ("italic" if run["italic"] else "normal"))
|
||||
if "underline" in run:
|
||||
style.append("text-decoration:" + ("underline" if run["underline"] else "none"))
|
||||
if "color" in run:
|
||||
style.append("color:" + run["color"])
|
||||
if "size" in run:
|
||||
|
||||
Reference in New Issue
Block a user