From 197d6680f7dca71364eeaa410f0e6ecdd4ffda5a Mon Sep 17 00:00:00 2001 From: Dominique Hazael-Massieux Date: Thu, 5 Sep 2024 13:52:38 +0200 Subject: [PATCH] Simplify detection of ancestor with a single selector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit per review suggestion Co-authored-by: François Daoust --- src/core/inlines.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/inlines.js b/src/core/inlines.js index bba816a3d1..8741896536 100644 --- a/src/core/inlines.js +++ b/src/core/inlines.js @@ -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; }