Repository navigation
Conversation
The chhorz javadoc-parser wraps {@code X} content verbatim in <code>X</code>
without HTML-escaping X. When X contains angle brackets (e.g. {@code <element>}),
Jsoup subsequently parses <element> as an unknown HTML tag and silently drops it
from the XML output, causing the tag name to disappear from the generated site.
This is visible in Maven's settings reference where descriptions such as
{@code <activeProfiles>} and {@code <activation>}
rendered with the tag name missing on the published site.
Fix: pre-process {@code} and {@literal} inline tags in XdocGenerator.rewrite()
by HTML-escaping their content before the javadoc-parser and Jsoup pipeline see
it. The escapeHtml() helper normalises pre-existing </> entities first
(which appear in CDATA-wrapped .mdo descriptions) so both forms are handled
correctly and produce identical output.
Add a test case to html4.mdo / html4.expected.xml that exercises the fix with
{@code <name>value</name>} (decoded to {@code <name>value</name>}
by MXParser) and verifies <code><name>value</name></code> in output.
This was referenced Oct 23, 2026
This branch has not been deployed
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.
Problem
The
chhorzjavadoc-parser wraps{@code X}content verbatim in<code>X</code>without HTML-escapingX. WhenXcontains angle brackets (e.g.{@code <element>}), Jsoup subsequently parses<element>as an unknown HTML tag and silently drops it from the XML output — the tag name disappears from the generated site.This is the root cause of apache/maven#13675, where descriptions such as:
{@code <activeProfiles>}{@code <activation>}{@code <name>value</name>}all render with the angle-bracket content missing on the published Maven site.
Root cause trace
In
XdocGenerator.rewrite():<description>outside CDATA and decodes<→<. So{@code <element>}in the.mdofile becomes{@code <element>}in the description string.<code><element></code>— the content is not HTML-escaped.<element>as an unknown element and drops it silently.Fix
Pre-process
{@code}and{@literal}inline tags inXdocGenerator.rewrite()to HTML-escape their content before the javadoc-parser and Jsoup pipeline see it.The
escapeHtml()helper normalises pre-existing</>entities first (which appear in CDATA-wrapped.mdodescriptions) so both forms are handled correctly and produce identical correct output:{@code <element>}(XML-decoded) →<code><element></code>✓{@code <element>}(from CDATA) →<code><element></code>✓Test
Added a field with
{@code <name>value</name>}(outside CDATA, so MXParser decodes it to{@code <name>value</name>}) tohtml4.mdoand verified the expected output<code><name>value</name></code>inhtml4.expected.xml.