Repository navigation
功能:Structured Content 支持跨页续表合并 - #48
Closed
kernelvale wants to merge 1 commit into
Closed
kernelvale wants to merge 1 commit into
kernelvale wants to merge 1 commit into
Conversation
Owner
|
感谢提交这个 PR。 目前 Structured Content 的定位是按页组织的 JSON 输出,因此跨页表格保留为各个物理页上的片段,是预期的设计。Markdown、HTML、DOCX 等面向连续阅读的输出,则在 render 阶段对已确认的跨页续表进行合并。 这里继续保留上述职责划分,不为按页 JSON 增加续表合并选项。如果需要跨页表格合并后的 JSON 输出,可以基于 MiddleJson 实现自定义 renderer,并根据自己的需求定义输出结构和拼接行为。 因此,这个 PR 按当前设计关闭。 |
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.
动机
Structured Content 目前即使遇到带有
continues_prev=True标记的表格,也会保留各个物理页面上的表格片段。需要逻辑表格的调用方只能先转换成其他格式,或者重新实现已有的合并逻辑。同时,按页消费结果的调用方仍需要保留原有的不合并表示。修改内容
StructuredContentRenderOptions和render_structured_content()新增merge_continued_tables选项,默认值为False。兼容性影响(可选)
无。默认输出保持不变。需要逻辑表格的调用方可通过
merge_continued_tables=True显式启用。使用场景(可选)
文档调用方需要把已标记的跨页表格作为一个逻辑表格消费时,可以直接启用该选项;其他调用方仍可保留物理页面表示,无需各自实现表格合并逻辑。
检查清单
提交前:
docs/JSON_PROTOCOL.md中补充选项说明。验证结果:
提交后: