From 7ff70f237ed5bc5dcc2c62711ab13be090f829d8 Mon Sep 17 00:00:00 2001 From: Rainer Date: Mon, 16 Feb 2026 19:30:42 +0800 Subject: [PATCH] fix: inline code block overflow --- scripts/render_xhs.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/render_xhs.py b/scripts/render_xhs.py index 1c5c048..8cd24a9 100644 --- a/scripts/render_xhs.py +++ b/scripts/render_xhs.py @@ -398,7 +398,12 @@ def generate_card_html(content: str, theme: str, page_number: int = 1, }} {theme_css} - + + .card-content :not(pre) > code {{ + overflow-wrap: anywhere; + word-break: break-word; + }} + .page-number {{ position: absolute; bottom: 80px; @@ -563,7 +568,7 @@ async def auto_split_content(body: str, theme: str, width: int, height: int, # 内容区域的可用高度(去除 padding 等) available_height = height - 220 # 50*2 padding + 60*2 inner padding - + if content_height > available_height and current_content: # 当前卡片已满,保存并开始新卡片 cards.append('\n\n'.join(current_content))