@tiptap/core 2.0.0-beta.162 → 2.0.0-beta.163

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,7 @@ export * from './inputRules/wrappingInputRule';
18
18
  export * from './pasteRules/markPasteRule';
19
19
  export * from './pasteRules/textPasteRule';
20
20
  export * from './utilities/callOrReturn';
21
+ export * from './utilities/escapeForRegEx';
21
22
  export * from './utilities/mergeAttributes';
22
23
  export * from './helpers/combineTransactionSteps';
23
24
  export * from './helpers/defaultBlockAt';
@@ -0,0 +1 @@
1
+ export declare function escapeForRegEx(string: string): string;
@@ -4083,6 +4083,11 @@ function textPasteRule(config) {
4083
4083
  });
4084
4084
  }
4085
4085
 
4086
+ // source: https://stackoverflow.com/a/6969486
4087
+ function escapeForRegEx(string) {
4088
+ return string.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
4089
+ }
4090
+
4086
4091
  /**
4087
4092
  * Returns a new `Transform` based on all steps of the passed transactions.
4088
4093
  */
@@ -4338,6 +4343,7 @@ exports.Tracker = Tracker;
4338
4343
  exports.callOrReturn = callOrReturn;
4339
4344
  exports.combineTransactionSteps = combineTransactionSteps;
4340
4345
  exports.defaultBlockAt = defaultBlockAt;
4346
+ exports.escapeForRegEx = escapeForRegEx;
4341
4347
  exports.extensions = extensions;
4342
4348
  exports.findChildren = findChildren;
4343
4349
  exports.findChildrenInRange = findChildrenInRange;