`getAncestry` does not escape node name · Issue #5078 · dequelabs/axe-core · GitHub
Skip to content

getAncestry does not escape node name #5078

Description

@straker

When using getAncestry and there exists an element with symbols in the node name, getAncestry does not escape the node name which results in an invalid selector.

<div>
  <hello="world">
    <button id="target'>button</button>
  </hello="world">
</div>

<script>
const selector = axe.utils.getAncestry(target);  // 'html > body > main:nth-child(2) > div:nth-child(2) > hello="world" > button

Activity

  1. added a commit that references this issue on Apr 22, 2026
    d1fabaa
  2. added a commit that references this issue on Apr 28, 2026
  3. added a commit that references this issue on Apr 28, 2026
    6e68d0a
  4. added a commit that references this issue on Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreIssues in the core code (lib/core)fixBug fixessupport

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions