Skip to content

Use <a id> rather than <a name> for the FAQ anchors - #1010

Merged
slachiewicz merged 1 commit into
masterfrom
faq-anchor-id
Aug 10, 2026
Merged

Use <a id> rather than <a name> for the FAQ anchors#1010
slachiewicz merged 1 commit into
masterfrom
faq-anchor-id

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

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 the
older plugin — with a green build, mvn site exiting 0, and no warning. That was
demonstrated elsewhere in the estate on a project still inheriting the older parent,
where all four anchors vanished silently.

<a id> works on both. Doxia's Xhtml5BaseParser reads Attribute.ID first and only
falls back to NAME, so id is the primary path — and name on <a> is obsolete in
HTML5 regardless.

This project inherits maven-plugins:49, which pulls 3.22.0, so the published
anchors 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.html actually
serves is unchanged:

question
top

plus the ids Doxia derives from the headings. The <head> is byte-identical, and the
build 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)

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)
@slachiewicz slachiewicz added the documentation Improvements or additions to documentation label Aug 10, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review August 10, 2026 01:10
@slachiewicz
slachiewicz merged commit 09213e3 into master Aug 10, 2026
20 of 21 checks passed
@slachiewicz
slachiewicz deleted the faq-anchor-id branch August 10, 2026 01:11
@github-actions github-actions Bot added this to the 3.6.4 milestone Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant