Skip to content

TIKA-4968: wrap OMML equations in span class=math in docx - #3318

Open
tballison wants to merge 1 commit into
apache:mainfrom
tballison:TIKA-4968
Open

tballison wants to merge 1 commit into
apache:mainfrom
tballison:TIKA-4968

Conversation

@tballison

Copy link
Copy Markdown
Contributor

Thanks for your contribution to Apache Tika! Your help is appreciated!

Before opening the pull request, please verify that

  • there is an open issue on the Tika issue tracker which describes the problem or the improvement. We cannot accept pull requests without an issue because the change wouldn't be listed in the release notes.
  • the issue ID (TIKA-XXXX)
    • is referenced in the title of the pull request
    • and placed in front of your commit messages surrounded by square brackets ([TIKA-XXXX] Issue or pull request title)
  • commits are squashed into a single one (or few commits for larger changes)
  • Tika builds and unit tests pass with ./mvnw clean install (clean test alone cannot resolve the pipes plugin zips)
  • if you used a generative AI tool: follow the ASF Generative Tooling Guidance (Generated-by: <tool> in the commit message), and consider running the pre-flight in .skills/devs/pr-review/SKILL.md — fix what it finds; don't paste its report here
  • there should be no conflicts when merging the pull request branch into the recent main branch. If there are conflicts, please try to rebase the pull request branch on top of a freshly pulled main branch
  • if you add new module that downstream users will depend upon add it to relevant group in tika-bom/pom.xml.

We will be able to faster integrate your pull request if these conditions are met. If you have any questions how to fix your problem or about using Tika in general, please sign up for the Tika mailing list. Thanks!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Hyperlink transitions can prematurely terminate math marking within an equation.

1 open finding
What changed in this PR

Adds XHTML identification for OMML equations in DOCX parsing.

Changes:

  • Detects m:oMath boundaries and emits <span class="math">.
  • Integrates math spans with existing formatting handling.
  • Adds regression coverage and release notes.
File Description
CHANGES.txt Documents OMML math marking.
XWPFBodyContentsHandler.java Adds math lifecycle callbacks.
OOXMLWordAndPowerPointTextHandler.java Detects OMML equation boundaries.
OOXMLTikaBodyPartHandler.java Delegates math span handling.
FormattingTagManager.java Manages math XHTML spans.
OOXMLDocxSAXTest.java Tests equation markup and formatting.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +183 to +184
* Opens {@code <span class="math">} for an OMML equation. A hyperlink change inside
* the equation closes it.
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.

2 participants