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

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