" not in html and "" not in html # every cell got the inline style
def test_post_title_with_and_without_headline():
diff --git a/us2kr/deliver/blogger.py b/us2kr/deliver/blogger.py
index d1c8272..dfb8934 100644
--- a/us2kr/deliver/blogger.py
+++ b/us2kr/deliver/blogger.py
@@ -28,6 +28,17 @@ TOKEN_SAFETY_MARGIN_SECONDS = 60.0
_MD = md.Markdown(extensions=["tables"], output_format="html")
+# Blogger themes ship no styling, so the numbers render as a borderless jumble.
+# Inline styles are the only thing every theme (and the mobile view) reliably honors.
+_TABLE_STYLES: tuple[tuple[str, str], ...] = (
+ ("", ''),
+ (
+ "| ",
+ ' | ',
+ ),
+ (" | ", ' | '),
+)
+
def briefing_html(markdown_text: str) -> str:
"""Briefing markdown -> HTML body. The leading H1 is dropped (the post title carries it)."""
@@ -35,7 +46,10 @@ def briefing_html(markdown_text: str) -> str:
if lines and lines[0].startswith("# "):
lines = lines[1:]
_MD.reset() # the converter keeps per-document state (e.g. reference links)
- return _MD.convert("\n".join(lines).strip())
+ html = _MD.convert("\n".join(lines).strip())
+ for plain, styled in _TABLE_STYLES:
+ html = html.replace(plain, styled)
+ return html
def post_title_prefix(result: BriefingResult) -> str:
| |