Skip to content

Commit 38beddb

Browse files
authored
Merge pull request #191 from btzy/main
Fix bug where autolink fails to recognize short URLs with non-empty paths
2 parents 9bd98e2 + 2030df7 commit 38beddb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/parser/autolink.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ fn check_domain(data: &[u8], allow_short: bool) -> Option<usize> {
114114
uscore2 = 0;
115115
np += 1;
116116
} else if !is_valid_hostchar(c) && c != '-' {
117-
if uscore1 == 0 && uscore2 == 0 && np > 0 {
117+
if uscore1 == 0 && uscore2 == 0 && (allow_short || np > 0) {
118118
return Some(i);
119119
}
120120
return None;

0 commit comments

Comments
 (0)