Skip to content

Commit d30dd80

Browse files
committed
tweak syntax for page name references
Signed-off-by: lubegasimon <[email protected]>
1 parent f4006cb commit d30dd80

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/model/reference.ml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,21 @@ let tokenize location s =
128128
scan_identifier started_at
129129
(open_parenthesis_count - 1)
130130
(index - 1) tokens
131+
| '"' when open_parenthesis_count = 0 -> (
132+
try
133+
scan_identifier started_at 0
134+
(String.rindex_from s (index - 1) '"' - 1)
135+
tokens
136+
with _ ->
137+
Error.raise_exception (Error.make "Unmatched quotation!" location) )
131138
| _ -> scan_identifier started_at open_parenthesis_count (index - 1) tokens
132139
and identifier_ended started_at index =
133140
let offset = index + 1 in
134141
let length = started_at - offset in
135142
let identifier = String.trim (String.sub s offset length) in
143+
let identifier =
144+
Astring.String.cuts ~sep:"\"" identifier |> String.concat ""
145+
in
136146
let location = Location_.in_string s ~offset ~length location in
137147

138148
if identifier = "" then

0 commit comments

Comments
 (0)