Skip to content

Add HtmlTag so the sink writers can leave javax.swing behind - #1097

Merged
slachiewicz merged 1 commit into
masterfrom
doxia-1092-htmltag
Sep 4, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
doxia-1092-htmltag

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Step 3 of #1092, additive. HtmlTag carries a tag name and an explicit isBlock, and AbstractXmlSink gains HtmlTag overloads of writeStartTag, writeEndTag and writeSimpleTag; the HTML.Tag-typed ones are deprecated for 2.3.0 and delegate. Step 4 then retypes the HtmlMarkup constants and drops the Swing supertype.

The block values are those the HtmlMarkup constants report today, copied unchanged: 24 of 117 tags are block, and HtmlTagTest reflects over HtmlMarkup to assert every one still answers the same, so a value cannot drift unnoticed and no generated site's whitespace moves. A tag Doxia does not declare — dir and noframes are the only block ones Swing has and Doxia lacks — keeps the block value of the Tag it was written with.

One source-compatibility wrinkle for subclasses: writeStartTag(null) and writeEndTag(null) are now ambiguous and need a cast. Both call sites in this repo were in AbstractXmlSinkTest.

Verified: mvn install → BUILD SUCCESS, all module suites green, japicmp clean on doxia-sink-api and doxia-core.

This change was created with AI assistance.

The writers read exactly one thing from javax.swing HTML.Tag: isBlock(), which
decides whether a start tag is preceded by a newline. HtmlTag carries the name
and that flag, with the values the HtmlMarkup constants report today copied
unchanged, so no generated site's whitespace moves; several of them are wrong for
HTML5 and correcting them is a separate change with its own site comparison.

The Tag-typed writeStartTag/writeEndTag/writeSimpleTag overloads are deprecated
and delegate, keeping a tag Doxia does not declare on its own block value.
Step 3 of #1092.
@slachiewicz slachiewicz added enhancement New feature or request deprecated Pull requests that deprecate features java Pull requests that update Java code labels Sep 3, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review September 3, 2026 23:03
@slachiewicz
slachiewicz merged commit 8b88b94 into master Sep 4, 2026
16 checks passed
@slachiewicz
slachiewicz deleted the doxia-1092-htmltag branch September 4, 2026 21:46
@github-actions github-actions Bot added this to the 2.2.0 milestone Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecated Pull requests that deprecate features enhancement New feature or request java Pull requests that update Java code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant