Fix conflicts and word break issues in v2 script

This commit is contained in:
neo-cloud-ai
2026-01-29 17:52:32 +08:00
parent 645fae4311
commit 55594c6e4f
2 changed files with 9 additions and 7 deletions

View File

@@ -2,9 +2,9 @@
"name": "md2redbook",
"version": "2.0.0",
"description": "小红书笔记素材创作工具 - 支持多种排版样式和智能分页",
"main": "scripts/render_xhs.js",
"main": "scripts/render_xhs_v2.js",
"scripts": {
"render": "node scripts/render_xhs.js",
"render": "node scripts/render_xhs_v2.js",
"install-browsers": "npx playwright install chromium"
},
"keywords": [
@@ -16,8 +16,8 @@
"author": "",
"license": "MIT",
"dependencies": {
"js-yaml": "^4.1.0",
"marked": "^11.0.0",
"yaml": "^2.3.0",
"playwright": "^1.40.0"
"playwright": "^1.58.0"
}
}
}

View File

@@ -342,7 +342,8 @@ def generate_cover_html(metadata: dict, style_key: str = "purple") -> str:
background-clip: text;
flex: 1;
display: flex; align-items: flex-start;
word-break: break-all;
word-break: normal;
overflow-wrap: break-word;
}}
.cover-subtitle {{
font-weight: 350; font-size: 72px; line-height: 1.4;
@@ -463,7 +464,8 @@ def generate_card_html(content: str, page_number: int = 1, total_pages: int = 1,
overflow-x: visible;
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-all;
word-break: normal;
overflow-wrap: break-word;
white-space: pre-wrap;
font-size: 36px; line-height: 1.5;
}}