Skip to content

Commit

Permalink
inlines: 0.31.2, Unicode punct includes S category too now.
Browse files Browse the repository at this point in the history
  • Loading branch information
kivikakk committed Jul 10, 2024
1 parent 42f4594 commit 2d6743e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/parser/autolink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ fn check_domain(data: &[u8], allow_short: bool) -> Option<usize> {
}

fn is_valid_hostchar(ch: char) -> bool {
!ch.is_whitespace() && !ch.is_punctuation()
!ch.is_whitespace() && !(ch.is_punctuation() || ch.is_symbol())
}

fn autolink_delim(data: &[u8], mut link_end: usize, relaxed_autolinks: bool) -> usize {
Expand Down
12 changes: 6 additions & 6 deletions src/parser/inlines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -998,20 +998,20 @@ impl<'a, 'r, 'o, 'd, 'i, 'c, 'subj> Subject<'a, 'r, 'o, 'd, 'i, 'c, 'subj> {

let left_flanking = numdelims > 0
&& !after_char.is_whitespace()
&& !(after_char.is_punctuation()
&& !((after_char.is_punctuation() || after_char.is_symbol())
&& !before_char.is_whitespace()
&& !before_char.is_punctuation());
&& !(before_char.is_punctuation() || before_char.is_symbol()));
let right_flanking = numdelims > 0
&& !before_char.is_whitespace()
&& !(before_char.is_punctuation()
&& !((before_char.is_punctuation() || before_char.is_symbol())
&& !after_char.is_whitespace()
&& !after_char.is_punctuation());
&& !(after_char.is_punctuation() || after_char.is_symbol()));

if c == b'_' {
(
numdelims,
left_flanking && (!right_flanking || before_char.is_punctuation()),
right_flanking && (!left_flanking || after_char.is_punctuation()),
left_flanking && (!right_flanking || before_char.is_punctuation() || before_char.is_symbol()),
right_flanking && (!left_flanking || after_char.is_punctuation() || after_char.is_symbol()),
)
} else if c == b'\'' || c == b'"' {
(
Expand Down

0 comments on commit 2d6743e

Please sign in to comment.