File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -629,7 +629,7 @@ export class _Tokenizer {
629629 endReg . lastIndex = 0 ;
630630
631631 // Clip maskedSrc to same section of string as src (move to lexer?)
632- maskedSrc = maskedSrc . slice ( - 1 * src . length + match [ 0 ] . length - 1 ) ;
632+ maskedSrc = maskedSrc . slice ( - 1 * src . length + lLength ) ;
633633
634634 while ( ( match = endReg . exec ( maskedSrc ) ) != null ) {
635635 rDelim = match [ 1 ] || match [ 2 ] || match [ 3 ] || match [ 4 ] || match [ 5 ] || match [ 6 ] ;
@@ -654,8 +654,9 @@ export class _Tokenizer {
654654
655655 // Remove extra characters. *a*** -> *a*
656656 rLength = Math . min ( rLength , rLength + delimTotal + midDelimTotal ) ;
657-
658- const raw = [ ...src ] . slice ( 0 , lLength + match . index + rLength + 1 ) . join ( '' ) ;
657+ // char length can be >1 for unicode characters;
658+ const lastCharLength = [ ...match [ 0 ] ] [ 0 ] . length ;
659+ const raw = src . slice ( 0 , lLength + match . index + lastCharLength + rLength ) ;
659660
660661 // Create `em` if smallest delimiter has odd char count. *a***
661662 if ( Math . min ( lLength , rLength ) % 2 ) {
Original file line number Diff line number Diff line change 1818< p > < strong > ⚠️ test</ strong > </ p >
1919< p > Here, the emoji rendering works, but the text doesn't get rendered in italic.</ p >
2020< p > < em > 💁 test</ em > </ p >
21+ < p > < em > t💁t</ em > test</ p >
22+ < p > < strong > t💁t</ strong > test</ p >
Original file line number Diff line number Diff line change @@ -37,3 +37,7 @@ Situations where it works:
3737Here, the emoji rendering works, but the text doesn't get rendered in italic.
3838
3939* 💁 test*
40+
41+ * t💁t* test
42+
43+ ** t💁t** test
You can’t perform that action at this time.
0 commit comments