File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,10 @@ const isDoubleQuote = (char) => /^[«»"“”„]$/.test(char)
99const isSingleQuote = ( char ) => / ^ [ ‘ ’ ‹ › ‚ ' ] $ / . test ( char )
1010const isApostrophe = ( char ) => / ^ [ ’ ' ] $ / . test ( char )
1111const isWhitespace = ( char ) => / ^ \s $ / . test ( char )
12+ const isSeparatorOrWhitespace = ( char ) => / \s | [ > \- – — ] / . test ( char )
1213
13- const shouldBeOpeningQuote = ( text , indexCharBefore ) => indexCharBefore < 0 || / \s | [ > \- – — ] / . test ( text [ indexCharBefore ] )
14- const shouldBeClosingQuote = ( text , indexCharBefore ) => ! ! text [ indexCharBefore ] && ! isWhitespace ( text [ indexCharBefore ] )
14+ const shouldBeOpeningQuote = ( text , indexCharBefore ) => indexCharBefore < 0 || isSeparatorOrWhitespace ( text [ indexCharBefore ] )
15+ const shouldBeClosingQuote = ( text , indexCharBefore ) => ! ! text [ indexCharBefore ] && ! isSeparatorOrWhitespace ( text [ indexCharBefore ] )
1516const hasCharAfter = ( textArr , indexCharAfter ) => ! ! textArr [ indexCharAfter ] && ! isWhitespace ( textArr [ indexCharAfter ] )
1617
1718const replaceQuote = ( range , index , quoteType ) => {
You can’t perform that action at this time.
0 commit comments