Skip to content

TIKA-4966: apply font formatting styles in docx - #3316

Merged
tballison merged 4 commits into
apache:mainfrom
tballison:TIKA-4966
Oct 17, 2026
Merged

tballison merged 4 commits into
apache:mainfrom
tballison:TIKA-4966

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

Style inheritance currently implements OOXML toggle properties incorrectly, and style-class normalization has a Unicode edge case.

3 open findings
What changed in this PR

Adds DOCX character-style formatting and optional XHTML style classes.

Changes:

  • Resolves bold/italic character styles and inheritance.
  • Adds configurable <span> classes with sanitized names.
  • Adds regression fixtures and tests.
File Description
CHANGES.txt Documents the feature.
WordExtractor.java Sanitizes style class names.
OfficeParserConfig.java Adds the character-style class option.
FormattingTagManager.java Manages style spans.
OOXMLTikaBodyPartHandler.java Applies effective run styles.
OOXMLWordAndPowerPointTextHandler.java Parses run style references.
RunProperties.java Tracks direct/style formatting state.
XWPFStylesShim.java Parses and resolves style inheritance.
WordParserTest.java Tests class-name conversion.
OOXMLDocxSAXTest.java Tests character-style XHTML output.

🧠 Review effort: Balanced


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

Comment thread CHANGES.txt
@tballison tballison changed the title TIKA-4996: apply font formatting styles in docx TIKA-4966: apply font formatting styles in docx Oct 17, 2026
@tballison
tballison merged commit fe5ba58 into apache:main Oct 17, 2026
4 checks passed
@tballison
tballison deleted the TIKA-4966 branch October 17, 2026 12:27
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