File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -725,7 +725,7 @@ export class Tokenizer {
725
725
endReg . lastIndex = 0 ;
726
726
727
727
// Clip maskedSrc to same section of string as src (move to lexer?)
728
- maskedSrc = maskedSrc . slice ( - 1 * src . length + match [ 0 ] . length - 1 ) ;
728
+ maskedSrc = maskedSrc . slice ( - 1 * src . length + lLength ) ;
729
729
730
730
while ( ( match = endReg . exec ( maskedSrc ) ) != null ) {
731
731
// eslint-disable-next-line
@@ -755,8 +755,9 @@ export class Tokenizer {
755
755
756
756
// Remove extra characters. *a*** -> *a*
757
757
rLength = Math . min ( rLength , rLength + delimTotal + midDelimTotal ) ;
758
-
759
- const raw = [ ...src ] . slice ( 0 , lLength + match . index + rLength + 1 ) . join ( "" ) ;
758
+ // char length can be >1 for unicode characters;
759
+ const lastCharLength = [ ...match [ 0 ] ] ! [ 0 ] ! . length ;
760
+ const raw = src . slice ( 0 , lLength + match . index + lastCharLength + rLength ) ;
760
761
761
762
// Create `em` if smallest delimiter has odd char count. *a***
762
763
if ( Math . min ( lLength , rLength ) % 2 ) {
You can’t perform that action at this time.
0 commit comments