Repository navigation
fix(docx): honor hidden n-ary limits - #2825
Open
林SO (Linxiushen) wants to merge 1 commit into
Open
林SO (Linxiushen) wants to merge 1 commit into
林SO (Linxiushen) wants to merge 1 commit into
Conversation
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.
DOCX n-ary equations can retain nonempty lower/upper limits while hiding them with
m:subHideorm:supHide.do_narycurrently emits both stored limits regardless of those properties, so the Markdown consumed by an LLM includes mathematical content that the document marks hidden.Filter the corresponding child before converting it. A present flag without
m:val, or with1/true/on, hides that bound; absent and disabled flags preserve it, following the lower and upper property definitions. The tests retain nonempty hidden values and exercise the flags independently, both together, and through publicMarkItDown.convert_stream()conversion of in-memory DOCX files.Validation on Windows, Python 3.12, against base
7482c092d9c0074a89803c9fdb63a969e7fe17fc:python -m pytest tests/test_docx_nary_visibility.py -q: 18 passed.python -m pytest tests/test_docx.py tests/test_html.py -q --basetemp <isolated-directory>: 134 passed, 1 skipped.pre-commit run --all-filesandgit diff --cached --check: passed.These are local converter correctness tests. Public conversion uses the bundled Magika file-type classifier; no LLM/provider, GPU, training or production evaluation was run. The complete Hatch matrix was not run locally.
Developed and tested with OpenAI Codex assistance.