Repository navigation
Conversation
…wn limit functions
scks1
force-pushed
the
fix-omml-missing-properties
branch
from
October 30, 2026 19:25
0a21061 to
1348426
Compare
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.
Summary
Two defects in DOCX math conversion, both reproduced on 0.1.9:
One bad equation aborted all math in the file.
_pre_process_mathreplaced equations in a loop with no per-equation guard, so a single
failing equation discarded every other equation's conversion in the
same document part.
Unknown limit functions raised
NotImplementedError.do_limlowraised for any limit function name not in its hardcodedtable, even though
do_fnamealready falls back to\operatorname{...}for unknown function names.Changes
pre_process.py:_replace_equationsguards each equationreplacement; a failing equation keeps its original OMML tag (inline and
inside
oMathPara), and the_pre_process_mathloops guard each callso one tag cannot abort the remaining equations.
omml.py:do_limlowstops raisingNotImplementedErrorfor anunknown limit function and falls back to
\operatorname{<name>}_{<lim>}, following the\operatornamefallback
do_fnamealready uses for unknown function names.Scope note
This PR originally also fixed
KeyErrorraised by five OMML handlers(
do_acc,do_bar,do_d,do_f,do_groupchr) when a propertieselement (
accPr,barPr,dPr,fPr,groupChrPr) is absent. Thosefixes and their tests have been withdrawn: #2445 already covers exactly
that defect, with tests of equal coverage. What remains here — the
per-equation isolation and the
do_limlowfallback — is not covered by#2445, and the isolation is also distinct from #2714, which drops a
failing block equation where this PR preserves its original OMML tag.
Tests
Three new tests in
tests/test_docx.py, each failing on 0.1.9 andpassing with this change: one for the
limLowfallback and two forper-equation isolation. The isolation tests use a
funcelement withno
fName, which still raises after these fixes, so they exercise theguard itself.
Full run of
tests/test_docx.pyon the narrowed tree: 104 passed.Disclosure: this contribution was prepared by Árbol, an AI assistant working under the direction of the account holder (scks1), who set the acceptance criteria and verified the results before submission.