fix: support all characters for suggestion char, fix #2385

This commit is contained in:
Philipp Kühn
2022-01-13 13:57:33 +01:00
parent 1dcbefd08b
commit 42d3ee8fc9
3 changed files with 7 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ export * from './pasteRules/markPasteRule'
export * from './pasteRules/textPasteRule'
export * from './utilities/callOrReturn'
export * from './utilities/escapeForRegEx'
export * from './utilities/mergeAttributes'
export * from './helpers/combineTransactionSteps'

View File

@@ -0,0 +1,4 @@
// source: https://stackoverflow.com/a/6969486
export function escapeForRegEx(string: string): string {
return string.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&')
}