Skip to content

Commit

Permalink
Underscores in comment Urls
Browse files Browse the repository at this point in the history
  • Loading branch information
tirix committed Sep 26, 2023
1 parent 4103ee4 commit 50eb059
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/comment_parser_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ fn test_label() {
b"Visit ~http://example.com",
&[Text(Span::new(0, 6)), Url(6, Span::new(7, 25))],
);

Check failure on line 214 in src/comment_parser_tests.rs

View workflow job for this annotation

GitHub Actions / Rebuild and test (ubuntu-20.04, stable)

Diff in /home/runner/work/metamath-knife/metamath-knife/src/comment_parser_tests.rs

Check failure on line 214 in src/comment_parser_tests.rs

View workflow job for this annotation

GitHub Actions / Rebuild and test (ubuntu-latest, stable)

Diff in /home/runner/work/metamath-knife/metamath-knife/src/comment_parser_tests.rs
check(
b"According to ~ https://en.wikipedia.org/wiki/Torsion_(algebra) , an element",
&[Text(Span::new(0, 13)), Url(13, Span::new(15, 62)), Text(Span::new(62, 75))],
);
}

#[test]
Expand Down
6 changes: 5 additions & 1 deletion src/verify_markup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,11 @@ fn verify_markup_comment(
CommentItem::Label(i, sp) | CommentItem::Url(i, sp) => {
ensure_space_before(buf, i, &mut diag);
ensure_space_after(buf, i, &mut diag);
check_uninterpreted_escapes(buf, sp, |_, d| diag(d));
check_uninterpreted_escapes(buf, sp, |c, d| {
if c != b'_' {
diag(d)
}
});
check_uninterpreted_html(buf, sp, &mut diag);
if matches!(item, CommentItem::Label(..)) {
temp_buffer.clear();
Expand Down

0 comments on commit 50eb059

Please sign in to comment.