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
When using
getAncestryand there exists an element with symbols in the node name,getAncestrydoes not escape the node name which results in an invalid selector.