Skip to content

fix(serializer): keep a pipe in a plain-text table cell - #1093

Open
BlackYuriJDU wants to merge 1 commit into
docling-project:mainfrom
BlackYuriJDU:fix/1076-plain-text-pipe
Open

BlackYuriJDU wants to merge 1 commit into
docling-project:mainfrom
BlackYuriJDU:fix/1076-plain-text-pipe

Conversation

@BlackYuriJDU

Copy link
Copy Markdown

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 (default True) keeps the current Markdown behavior.
  • PlainTextParams sets it to False, so export_to_text() emits 0|1 while export_to_markdown() still emits 0|1.

Tests

New test_plain_text_keeps_a_pipe_in_a_table_cell builds the issue's document (a paragraph with a pipe and a 2x2 table with 0|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.types pulls the code chunker's tree_sitter dependencies, which are not installed here. compileall, ruff check and ruff format --check are clean; CI runs the suite.

AI assistance disclosure: developed with an AI coding agent (OpenCode).

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>
@github-actions

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

Thanks @BlackYuriJDU, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 1 of 2 protections blocking · waiting on 👀 reviews

Protection Waiting on
🔴 Require two reviewer for test updates 👀 reviews
🟢 Enforce conventional commit —

🔴 Require two reviewer for test updates

Waiting for

  • #approved-reviews-by >= 2
This rule is failing.

When test data is updated, we require two reviewers

  • #approved-reviews-by >= 2

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@github-actions github-actions Bot added bug Something isn't working serialization Output serializers: Markdown, HTML, LaTeX, JSON, plain-text, outline labels Nov 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

AI triage (advisory)

Checked commit 2799f464af. The analysis read the diff only. It did not run code from this pull request.

Warning

The AI analysis did not finish. Only the deterministic checks are shown.

Topic labels added: bug, serialization.

CI safety: not assessed.

Possibly related pull requests

PR State Signal Assessment
#1008 open changes the same code not assessed
#124 merged referenced as #124 not assessed

The ai:* labels are advisory. They do not approve CI and they do not add tests:full. A new push runs this check again.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working serialization Output serializers: Markdown, HTML, LaTeX, JSON, plain-text, outline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

export_to_text() writes a pipe in a table cell as &#124;

1 participant