summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
author孙茂胤 (Sun, Maoyin) <simonmysun@gmail.com>2023-04-18 09:42:15 +0200
committerGitHub <noreply@github.com>2023-04-18 01:42:15 -0600
commit768f0aabc1279e7fbcacc01efcab8c38915f7215 (patch)
tree83900b29c32410cb508e510ea3bbad14dbdb33ca /lib
parentaeebabc689eb5d526f643a9e99db68b39bbb150a (diff)
resolves #4393 avoid matching numeric character references when searching for # in xref target (PR #4394)
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor/substitutors.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/asciidoctor/substitutors.rb b/lib/asciidoctor/substitutors.rb
index 42fda33c..5dc4cc59 100644
--- a/lib/asciidoctor/substitutors.rb
+++ b/lib/asciidoctor/substitutors.rb
@@ -756,7 +756,7 @@ module Substitutors
if doc.compat_mode
fragment = refid
- elsif (hash_idx = refid.index '#')
+ elsif (hash_idx = refid.index '#') && refid[hash_idx - 1] != '&'
if hash_idx > 0
if (fragment_len = refid.length - 1 - hash_idx) > 0
path, fragment = (refid.slice 0, hash_idx), (refid.slice hash_idx + 1, fragment_len)