Skip to content

fix: preserve malformed docx math content#1998

Open
he-yufeng wants to merge 1 commit into
microsoft:mainfrom
he-yufeng:fix/docx-math-fallbacks
Open

fix: preserve malformed docx math content#1998
he-yufeng wants to merge 1 commit into
microsoft:mainfrom
he-yufeng:fix/docx-math-fallbacks

Conversation

@he-yufeng
Copy link
Copy Markdown

Summary

  • keep malformed OMML tags from crashing the DOCX math preprocessor when no namespaced oMath child is found
  • render unknown OMML function names with \operatorname{...} instead of raising NotImplementedError
  • add focused regression tests for the missing-child and unknown-function paths

Fixes #1979.
Fixes #1982.

To verify

  • $env:PYTHONPATH=(Resolve-Path packages\markitdown\src).Path; python -m pytest packages\markitdown\tests\test_docx_math.py -q
  • python -m py_compile packages\markitdown\src\markitdown\converter_utils\docx\pre_process.py packages\markitdown\src\markitdown\converter_utils\docx\math\omml.py packages\markitdown\tests\test_docx_math.py
  • git diff --check

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

Labels

None yet

Projects

None yet

1 participant