Use <a id> rather than <a name> for the FAQ anchors - #1010
Merged
Conversation
maven-site-plugin 3.21.0 drops the name attribute from inline HTML anchors while 3.22.0 keeps it, so a page written with <a name> loses its anchors on the older plugin with a green build and no warning. Doxia's Xhtml5BaseParser reads Attribute.ID first and only falls back to NAME, so id is the primary path; name on <a> is also obsolete in HTML5. This project builds with 3.22.0 today, so the published anchors are not currently affected. The change makes the page correct on both, and keeps it correct if it is ever back-ported to a line with an older toolchain. It also aligns this FAQ with the rest of the estate-wide FML to Markdown conversion, which now uses <a id> throughout. Verified by generating the site and comparing the anchors the generated faq.html serves. Unchanged: question and top are both still served, the <head> is byte-identical, and the build emits no duplicate-anchor warning. Generated-by: Claude Opus 5 (1M context)
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.
Follow-up to #1009. That PR converted the FAQ from FML to Markdown and landed with
the anchors written as
<a name>; this switches them to<a id>.Why this matters
maven-site-plugin 3.21.0 strips the
name=attribute from inline HTML anchors;3.22.0 keeps it. A page written with
<a name>therefore loses its anchors on theolder plugin — with a green build,
mvn siteexiting 0, and no warning. That wasdemonstrated elsewhere in the estate on a project still inheriting the older parent,
where all four anchors vanished silently.
<a id>works on both. Doxia'sXhtml5BaseParserreadsAttribute.IDfirst and onlyfalls back to
NAME, soidis the primary path — andnameon<a>is obsolete inHTML5 regardless.
This project inherits
maven-plugins:49, which pulls 3.22.0, so the publishedanchors are not currently affected. This is a correctness and consistency fix rather
than a live breakage: it makes the page right on both versions, keeps it right if the
FAQ is ever back-ported to a maintenance line with an older toolchain, and aligns this
file with the rest of the estate-wide FML-to-Markdown conversion, which uses
<a id>throughout.
Verification
Site generated before and after; the set of anchors the generated
faq.htmlactuallyserves is unchanged:
plus the ids Doxia derives from the headings. The
<head>is byte-identical, and thebuild emits no duplicate-anchor warning.
Both anchors are load-bearing here and are kept: the FML id was the slug
question,which the question text does not reproduce, so neither is redundant with a
heading-derived id.
Generated-by: Claude Opus 5 (1M context)