mirror of
https://github.com/comeonzhj/Auto-Redbook-Skills.git
synced 2026-03-27 12:49:27 +08:00
fix: inline code block overflow
This commit is contained in:
@@ -398,7 +398,12 @@ def generate_card_html(content: str, theme: str, page_number: int = 1,
|
|||||||
}}
|
}}
|
||||||
|
|
||||||
{theme_css}
|
{theme_css}
|
||||||
|
|
||||||
|
.card-content :not(pre) > code {{
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
word-break: break-word;
|
||||||
|
}}
|
||||||
|
|
||||||
.page-number {{
|
.page-number {{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 80px;
|
bottom: 80px;
|
||||||
@@ -563,7 +568,7 @@ async def auto_split_content(body: str, theme: str, width: int, height: int,
|
|||||||
|
|
||||||
# 内容区域的可用高度(去除 padding 等)
|
# 内容区域的可用高度(去除 padding 等)
|
||||||
available_height = height - 220 # 50*2 padding + 60*2 inner padding
|
available_height = height - 220 # 50*2 padding + 60*2 inner padding
|
||||||
|
|
||||||
if content_height > available_height and current_content:
|
if content_height > available_height and current_content:
|
||||||
# 当前卡片已满,保存并开始新卡片
|
# 当前卡片已满,保存并开始新卡片
|
||||||
cards.append('\n\n'.join(current_content))
|
cards.append('\n\n'.join(current_content))
|
||||||
|
|||||||
Reference in New Issue
Block a user