Skip to content

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

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#842
slachiewicz merged 1 commit into
masterfrom
faq-anchor-id

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Follow-up to the FML → Markdown FAQ conversion, which is already merged here.

<a id> instead of <a name>

maven-site-plugin 3.21.0 strips the name= attribute from an inline HTML anchor; 3.22.0
keeps it.
On 3.21.0 every anchor on the page is lost silently, on a green build with
mvn site exiting 0. This repo builds with a parent that pulls 3.22.0, so the page is
correct as it stands — but <a id> is the form that survives either way, and it is the
right one regardless:

  • Xhtml5BaseParser reads Attribute.ID first and only falls back to NAME, so id= is
    the primary path.
  • name= on <a> is obsolete in HTML5.

Anchors stay on their own line; folding one into the heading text suppresses the section's
own generated id.

Verification

Rendered faq.html before and after this change:

  • the anchor set is unchanged, and still a superset of every anchor the original FML
    page served, so no deep link changes;
  • the <head> is byte-identical;
  • the visible text matches the FML original word for word;
  • the site log reports no used more than once anchor warning.

target/site was deleted before each build and the page confirmed regenerated, so this is
not a stale-output pass.

Drafted with Claude — please verify

Follow-up to the FML to Markdown conversion.

maven-site-plugin 3.21.0 strips the name= attribute from an inline HTML
anchor; 3.22.0 keeps it. On 3.21.0 every anchor on the page is therefore
lost silently, on a green build. This repo builds with a parent that
pulls 3.22.0, so the pages are correct today, but <a id> is the form
that survives either way - and Xhtml5BaseParser reads Attribute.ID
first, falling back to NAME only if it is absent, so id= is the primary
path. name= on <a> is obsolete in HTML5 besides.

Each anchor stays on its own line; folding one into the heading text
suppresses the section's own generated id.

Verified by rendering faq.html before and after: the anchor set is
unchanged and still a superset of what the original FML page served,
the <head> is byte-identical, the visible text matches the FML original
word for word, and the site log reports no "used more than once"
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 00:59
@slachiewicz
slachiewicz merged commit db65da2 into master Aug 10, 2026
5 of 15 checks passed
@slachiewicz
slachiewicz deleted the faq-anchor-id branch August 10, 2026 00:59
@github-actions github-actions Bot added this to the 3.6.3 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