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)
9
9
const isSingleQuote = ( char ) => / ^ [ ‘ ’ ‹ › ‚ ' ] $ / . test ( char )
10
10
const isApostrophe = ( char ) => / ^ [ ’ ' ] $ / . test ( char )
11
11
const isWhitespace = ( char ) => / ^ \s $ / . test ( char )
12
+ const isSeparatorOrWhitespace = ( char ) => / \s | [ > \- – — ] / . test ( char )
12
13
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 ] )
15
16
const hasCharAfter = ( textArr , indexCharAfter ) => ! ! textArr [ indexCharAfter ] && ! isWhitespace ( textArr [ indexCharAfter ] )
16
17
17
18
const replaceQuote = ( range , index , quoteType ) => {
You can’t perform that action at this time.
0 commit comments