Skip to content

Commit

Permalink
Simplify detection of ancestor with a single selector
Browse files Browse the repository at this point in the history
per review suggestion

Co-authored-by: François Daoust <[email protected]>
  • Loading branch information
dontcallmedom and tidoust authored Sep 5, 2024
1 parent a9285fa commit 197d668
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/inlines.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function inlineXrefMatches(matched, text) {
// If it's inside a dfn or a `a`, it should just be coded, not linked.
// This is because dfn elements are treated as links by ReSpec via role=link.
const renderAsCode =
!!text.parentElement.closest("dfn") || !!text.parentElement.closest("a");
!!text.parentElement.closest("dfn,a");
return renderAsCode ? inlineCodeMatches(`\`${node.textContent}\``) : node;
}

Expand Down

0 comments on commit 197d668

Please sign in to comment.