Skip to content

Commit

Permalink
In determining "before_char", skip standard variation selector.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Aug 17, 2024
1 parent 5c0c7cb commit 09c76da
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/inlines.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,18 @@ static int scan_delims(subject *subj, unsigned char c, bool *can_open,
if (len == -1) {
before_char = 10;
}
if (before_char >= 0xfe00 && before_char <= 0xfe02) {
// standard variation selector, go back one more code point:
while (peek_at(subj, before_char_pos) >> 6 == 2 &&
before_char_pos > 0) {
before_char_pos -= 1;
}
len = cmark_utf8proc_iterate(subj->input.data + before_char_pos,
subj->pos - before_char_pos, &before_char);
if (len == -1) {
before_char = 10;
}
}
}

if (c == '\'' || c == '"') {
Expand Down

0 comments on commit 09c76da

Please sign in to comment.