Skip to content

Support "name" attribute in "a" element still in XHTML5 - #1031

Merged
kwin merged 1 commit into
masterfrom
bugfix/accept-anchor-with-name-even-in-xhtml5
Feb 11, 2026
Merged

kwin merged 1 commit into
masterfrom
bugfix/accept-anchor-with-name-even-in-xhtml5

Conversation

@kwin

@kwin kwin commented Feb 10, 2026

Copy link
Copy Markdown
Member

This is also suggested by
https://www.w3.org/TR/html5-diff/#obsolete-attributes:

"The following attributes are allowed...:
... The name attribute on a."

This closes #1020

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@kwin
kwin requested a review from michael-o February 10, 2026 19:29
This is also suggested by
https://www.w3.org/TR/html5-diff/#obsolete-attributes:

"The following attributes are allowed...:
... The name attribute on a."

and https://html.spec.whatwg.org/#obsolete-but-conforming-features

"Authors should not specify the name attribute on a elements. If the
attribute is present, its value must not be the empty string and must
neither be equal to the value of any of the IDs in the element's tree
other than the element's own ID, if any, nor be equal to the value of
any of the other name attributes on a elements in the element's tree. If
this attribute is present and the element has an ID, then the
attribute's value must be equal to the element's ID. In earlier versions
of the language, this attribute was intended as a way to specify
possible targets for fragments in URLs. The id attribute should be used
instead."

This closes #1020
@kwin
kwin force-pushed the bugfix/accept-anchor-with-name-even-in-xhtml5 branch from 3487243 to 0af34a4 Compare February 10, 2026 19:33
@michael-o

Copy link
Copy Markdown
Member

Do you have some fallback case where this makes sense?

@kwin

kwin commented Feb 10, 2026

Copy link
Copy Markdown
Member Author

See #1020

@michael-o michael-o left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reasonable

@kwin
kwin merged commit 48166bc into master Feb 11, 2026
14 checks passed
@kwin
kwin deleted the bugfix/accept-anchor-with-name-even-in-xhtml5 branch February 11, 2026 07:03
@kwin kwin added the bug Something isn't working label Feb 11, 2026
@github-actions github-actions Bot added this to the 2.1.0 milestone Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

markdown anchors with name attribute not processed

2 participants