Repository navigation
fix: preserve PDF list numbering, signature underscores, and Buffer input safety - #220
Merged
Merged
Conversation
- Redesign README: centered header, logo, badges, landing/workbench screenshots, emoji section markers, star CTA - Fix 14 broken links: i18n READMEs under docs/i18n/, relocated docs (CONVERSION_PATHS, SECURITY_POLICY, CONVERSION_ROUTING, INSTALL, PP_OCRV5_BROWSER_VERIFICATION), schema JSON replaces deleted md - Add docs/assets/: generated logo + fresh 2160x1350 app screenshots - Archive 4 internal process reports to docs/development/ - .gitignore: ignore .tmp-* scratch files
…nput safety - PDF 版面分析:同类列表项行距放宽到 3 倍行高合并(原 1.6 倍阈值会把 2 倍行距的 条款列表拆成单条 list,writer 将每项都从 1 重新编号) - markdown 剥离不再吞纯下划线串:PDF 签名线 "Date: ____________" 此前被正则 回溯逐轮缩减(12→8→6),影响 txt/json/csv/xlsx/pptx 输出 - PDF.js 提取前将 Node Buffer 复制为独立 Uint8Array,避免 transfer 共享内存池 导致无关数据被 detach - 回归测试:layout-offset 增加列表合并/打断/下划线断言;pdf-reader 增加 Buffer 输入池安全测试(含 pdfjs 缺失环境守卫) Refs #216
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
修复 PDF 转换链路的三个问题(延续 #216 的 PDF 可靠性主题):
变更内容
public/formats/pdf.jscoercePdfBytes:Node Buffer 先复制为独立Uint8Array再交给 PDF.js,避免 transfer 共享内存池导致无关数据被 detach。analyzeSingleColumnLayout:新增lastLineWasListItem状态;列表合并条件改为paragraphTextBuffer.length === 0 && lastBlock?.type === "list" && lastBlock.ordered === ordered && (!isNewBlock || (lastLineWasListItem && yGap <= lastHeight * 3.0))——同类列表项行距阈值由 1.6 倍放宽到 3 倍行高且要求上一行为列表项,段落打断后不再合并。public/formats/text-utils.js:stripMarkdownInlineSyntax的两条下划线强调正则增加(?!_)/(?<!_)守卫,纯下划线串(如 PDF 签名线Date: ____________)不再被缩减;真实__强调__标记仍正常剥离。scripts/layout-offset-regression-test.js:新增断言——2 倍行距列表合并为单块 4 项、>3 倍行距不合并、段落打断列表、下划线串 round-trip 保留、真强调标记仍剥离。scripts/pdf-reader-test.js:新增测试 13(Buffer 输入经expandPdfContentForTextExtraction后共享池哨兵与输入字节均存活;带pdfjsAvailable守卫,缺 pdfjs 环境跳过)。CHANGELOG.md、docs/development/DEVELOPMENT_TASKS.md:补充本次修复记录。测试验证
npm test(50 个脚本)双向验证全绿:含 pdfjs-dist 环境与隐藏 pdfjs-dist 环境(缺 pdfjs 时相关用例跳过而非失败)均通过。scripts/lib/validate-mixed-pdf.mjs,本地验证脚本,未入库)。node --check四个改动脚本语法通过;git diff --check无空白问题。相关 Issue
Refs #216
注意事项
package.json、public/landing-view.js、public/styles.css、public/styles/landing.css),属并行工作,未包含在本 PR。