Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cjk branch] Fix variation selector handling & tests #556

Merged
merged 3 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/inlines.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ static int scan_delims(subject *subj, unsigned char c, bool *can_open,
}
if (before_char >= 0xfe00 && before_char <= 0xfe02) {
// standard variation selector, go back one more code point:
before_char_pos -= 1;
while (peek_at(subj, before_char_pos) >> 6 == 2 &&
before_char_pos > 0) {
before_char_pos -= 1;
Expand Down
2 changes: 1 addition & 1 deletion src/utf8.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ int cmark_utf8proc_is_CJK(int32_t uc) {
|| (uc >= 0x30000 && uc <= 0x3134F) // CJK Unified Ideographs Extension G
|| (uc >= 0x31350 && uc <= 0x323AF) // CJK Unified Ideographs Extension H
// || (uc >= 0x323B0 && */ uc <= 0x3FFFF) // Unused TIP region (probably CJK characters will be allocated)
|| (uc >= 0xE0100 && uc <= 0xE01FF) // Ideographic Variation Sequences
|| (uc >= 0xE0100 && uc <= 0xE01EF) // Ideographic Variation Sequences
);
}
}
8 changes: 4 additions & 4 deletions test/cjkemphasis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,9 @@ Git**(注:不是GitHub)**


```````````````````````````````` example
**(U+317DB)**
𱟛**(U+317DB)**
.
<p><strong>(U+317DB)</strong></p>
<p>𱟛<strong>(U+317DB)</strong></p>
````````````````````````````````


Expand All @@ -618,9 +618,9 @@ Git**(注:不是GitHub)**


```````````````````````````````` example
大塚︀**(or 大塚 / 大塚)**
大塚︀**(U+585A U+FE00)** 大塚**(U+FA10)**
.
<p>大塚︀<strong>(or 大塚 / 大塚)</strong></p>
<p>大塚︀<strong>(U+585A U+FE00)</strong> 大塚<strong>(U+FA10)</strong></p>
````````````````````````````````