Repository navigation
fix(serializer): keep a pipe in a plain-text table cell - #1093
Open
BlackYuriJDU wants to merge 1 commit into
Open
BlackYuriJDU wants to merge 1 commit into
BlackYuriJDU wants to merge 1 commit into
Conversation
export_to_text() inherited the Markdown table serializer, which escapes every pipe as &docling-project#124;. Plain text keeps the pipe as the cell's text, as its docstring already promised. Add escape_table_pipes to MarkdownParams (default True) and turn it off in PlainTextParams, so Markdown tables keep the escape and plain text does not. Fixes docling-project#1076 Signed-off-by: Arthur Araujo da Silva <arthuraviacao55@gmail.com>
Contributor
|
✅ DCO Check Passed Thanks @BlackYuriJDU, all your commits are properly signed off. 🎉 |
Contributor
Merge Protections🔴 1 of 2 protections blocking · waiting on 👀 reviews
🔴 Require two reviewer for test updatesWaiting for
This rule is failing.When test data is updated, we require two reviewers
Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Contributor
AI triage (advisory)Checked commit Warning The AI analysis did not finish. Only the deterministic checks are shown. Topic labels added: CI safety: not assessed. Possibly related pull requests
The |
This branch has not been deployed
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.
Fixes #1076
export_to_text()builds on the Markdown table serializer, which escapes every|in a cell as|. The plain-text docstring already says the cell separators are kept because they aid readability, so the cell text should keep its pipe too.MarkdownParams.escape_table_pipes(defaultTrue) keeps the current Markdown behavior.PlainTextParamssets it toFalse, soexport_to_text()emits0|1whileexport_to_markdown()still emits0|1.Tests
New
test_plain_text_keeps_a_pipe_in_a_table_cellbuilds the issue's document (a paragraph with a pipe and a 2x2 table with0|1/x<y & z) and asserts the plain-text export keeps the pipe while the Markdown export still escapes it.I could not run the test locally: importing
docling_core.typespulls the code chunker'stree_sitterdependencies, which are not installed here.compileall,ruff checkandruff format --checkare clean; CI runs the suite.AI assistance disclosure: developed with an AI coding agent (OpenCode).