Skip to content

fix(pdf): remove NUL characters from parsed text#3868

Open
Success6666 wants to merge 1 commit into
docling-project:mainfrom
Success6666:fix/pdf-nul-text-sanitization
Open

fix(pdf): remove NUL characters from parsed text#3868
Success6666 wants to merge 1 commit into
docling-project:mainfrom
Success6666:fix/pdf-nul-text-sanitization

Conversation

@Success6666

Copy link
Copy Markdown
Contributor

Summary

  • remove embedded NUL characters from parsed PDF text cells before they enter downstream document assembly
  • sanitize character, word, and text-line cells for both standard and threaded Docling Parse backends
  • preserve valid Unicode text, including superscript unit exponents

Issue resolved by this Pull Request:
Resolves #3858

Tests

  • python -m pytest tests/test_backend_docling_parse.py -q (24 passed)
  • changed-file prek hooks (Ruff, formatter, ty, Tach)
  • converted the issue's 22-page source PDF with ConversionStatus.SUCCESS and verified zero NUL characters in both exported Markdown and the full serialized DoclingDocument

Checklist:

  • Documentation has been updated, if necessary.
  • Examples have been added, if necessary.
  • Tests have been added, if necessary.

Signed-off-by: 李政达 <1242427577@qq.com>
@github-actions

Copy link
Copy Markdown
Contributor

DCO Check Passed

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

@mergify

mergify Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 Merge protection satisfied — ready to merge.

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)(?:\(.+\))?(!)?:

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

export_to_markdown() embeds NUL bytes (\x00) for superscript unit/exponent glyphs, causing silent truncation downstream

1 participant