fix: tables fill the column as a card, matching common Markdown viewers (v2.18.2)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PhilandClaude Opus 5.5 committed 2026-11-12 13:24:37 -07:00
1 parent 41c373f46c
commit bba2178496
4 files changed
+25 -10

No files matched your search

+3 -1
View File
@@ -62,7 +62,9 @@ ALLOWED_ATTRIBUTES = {
def render_markdown(text: str) -> str:
"""Note Markdown (or HTML) to sanitized HTML"""
html = markdown.markdown(text, extensions=MARKDOWN_EXTENSIONS)
return nh3.clean(html, tags=ALLOWED_TAGS, attributes=ALLOWED_ATTRIBUTES)
html = nh3.clean(html, tags=ALLOWED_TAGS, attributes=ALLOWED_ATTRIBUTES)
# A wrapper lets a table fill the column yet scroll sideways when too wide (v2.18.2)
return re.sub(r"<table\b", '<div class="table-wrap"><table', html).replace("</table>", "</table></div>")
# Likes, reposts and bookmarks (v2.5.0, v2.9.0)