Skip to content

Commit 7b52dbf

Browse files
tools: fix support for numbers in urls in v check-md (#10483)
1 parent 30fac1f commit 7b52dbf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd/tools/vcheck-md.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ mut:
266266
}
267267

268268
fn (mut ad AnchorData) add_links(line_number int, line string) {
269-
query := r'\[(?P<lable>[^\]]+)\]\(\s*#(?P<link>[a-z\-]+)\)'
269+
query := r'\[(?P<lable>[^\]]+)\]\(\s*#(?P<link>[a-z0-9\-]+)\)'
270270
mut re := regex.regex_opt(query) or { panic(err) }
271271
res := re.find_all_str(line)
272272

@@ -292,7 +292,7 @@ fn (mut ad AnchorData) add_link_targets(line_number int, line string) {
292292
}
293293
}
294294
} else {
295-
query := r'<a\s*id=["\'](?P<link>[a-z\-]+)["\']\s*/>'
295+
query := r'<a\s*id=["\'](?P<link>[a-z0-9\-]+)["\']\s*/>'
296296
mut re := regex.regex_opt(query) or { panic(err) }
297297
res := re.find_all_str(line)
298298
@@ -352,7 +352,7 @@ fn (mut ad AnchorData) check_link_target_match(fpath string, mut res CheckResult
352352
}
353353
354354
fn create_ref_link(s string) string {
355-
query_remove := r'[^a-z \-]'
355+
query_remove := r'[^a-z0-9 \-]'
356356
mut re := regex.regex_opt(query_remove) or { panic(err) }
357357
return re.replace_simple(s.to_lower(), '').replace(' ', '-')
358358
}

0 commit comments

Comments
 (0)