Skip to content

Stop marking external links with the externalLink class - #1099

Merged
slachiewicz merged 1 commit into
masterfrom
agent/drop-externallink-class
Sep 10, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
agent/drop-externallink-class

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Xhtml5BaseSink adds class="externalLink" to every link that DoxiaUtils.isExternalLink matches. The class exists so a skin can paint an icon on outbound links — and Fluido Skin 2.1.0 removed those icons and the 46 lines of CSS behind them (MSKINS-262), along with the class on its own navigation links. So today Doxia stamps the attribute into every generated page and nothing in the stack styles it. This finishes that migration on the Doxia side.

This changes generated HTML for every project, which is the part worth arguing about before it merges:

  • A third-party skin or a project stylesheet that targets a.externalLink loses its hook. Within apache/maven-* only two stylesheets referenced it, both to cancel Fluido's icons, and both are being removed (Update site documentation for the Doxia 2 site descriptor maven-site#1674 merged, Drop the CSS that suppressed Fluido's external link icons maven-scm#1400 open) — but the estate is not the whole population of skins.
  • The attribute is also a semantic marker, not only a styling hook. Removing it means a skin can no longer tell outbound links apart without re-implementing the check.
  • Behaviour also changes for callers that pass their own class: externalLink used to be prepended to it, so class="cs1 cs2" became class="externalLink cs1 cs2". It now stays class="cs1 cs2".

If the tradeoff is not wanted, the alternative that keeps the marker and still ends the dead-weight problem is to leave Doxia alone and document the class as skin-owned. I have no strong view on which; the version this lands in matters more than the change itself.

Verified: full mvn install green. Three assertions updated to match — two in Xhtml5BaseSinkTest (including the caller-supplied-class case) and one in Xhtml5SinkTest. DoxiaUtils.isExternalLink stays; Xhtml5BaseParser and the APT module still use it.

This change was created with AI assistance.

The class existed so a skin could paint an icon on outbound links. Fluido Skin
2.1.0 removed those icons and the CSS behind them (MSKINS-262), so the class
is emitted into every page and styled by nothing. Note this also changes the
caller-supplied class case: externalLink used to be prepended to it.
@slachiewicz slachiewicz added the breaking Pull requests that break existing features label Sep 10, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review September 10, 2026 11:25
@slachiewicz
slachiewicz merged commit 3061d70 into master Sep 10, 2026
14 of 15 checks passed
@slachiewicz
slachiewicz deleted the agent/drop-externallink-class branch September 10, 2026 12:18
@github-actions github-actions Bot added this to the 2.2.0 milestone Sep 10, 2026
slachiewicz added a commit to apache/maven-doxia-sitetools that referenced this pull request Oct 20, 2026
Doxia 2.2.0 no longer marks external links with class="externalLink"
(apache/maven-doxia#1099); the renderer tests now expect no class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Pull requests that break existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant