roamjs-components 0.83.6 → 0.83.7

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "roamjs-components",
3
3
  "description": "Expansive toolset, utilities, & components for developing RoamJS extensions.",
4
- "version": "0.83.6",
4
+ "version": "0.83.7",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {
@@ -1,2 +1,2 @@
1
- declare const createTagRegex: (tag: string) => RegExp;
1
+ declare const createTagRegex: (title: string) => RegExp;
2
2
  export default createTagRegex;
@@ -1,5 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const createTagRegex = (tag) => new RegExp(`#?\\[\\[${tag}\\]\\]|#${tag}`);
3
+ const createTagRegex = (title) => {
4
+ const escapedTitle = title.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
5
+ return new RegExp(`(?:#\\[\\[${escapedTitle}\\]\\]|#${escapedTitle}(?!\\w)|\\[\\[${escapedTitle}\\]\\])`);
6
+ };
4
7
  exports.default = createTagRegex;
5
8
  //# sourceMappingURL=createTagRegex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createTagRegex.js","sourceRoot":"","sources":["../../src/util/createTagRegex.ts"],"names":[],"mappings":";;AAAA,MAAM,cAAc,GAAG,CAAC,GAAW,EAAU,EAAE,CAC7C,IAAI,MAAM,CAAC,WAAW,GAAG,WAAW,GAAG,EAAE,CAAC,CAAC;AAE7C,kBAAe,cAAc,CAAC","sourcesContent":["const createTagRegex = (tag: string): RegExp =>\n new RegExp(`#?\\\\[\\\\[${tag}\\\\]\\\\]|#${tag}`);\n\nexport default createTagRegex;\n"]}
1
+ {"version":3,"file":"createTagRegex.js","sourceRoot":"","sources":["../../src/util/createTagRegex.ts"],"names":[],"mappings":";;AAAA,MAAM,cAAc,GAAG,CAAC,KAAa,EAAU,EAAE;IAC/C,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IAClE,OAAO,IAAI,MAAM,CACf,aAAa,YAAY,WAAW,YAAY,iBAAiB,YAAY,SAAS,CACvF,CAAC;AACJ,CAAC,CAAC;AACF,kBAAe,cAAc,CAAC","sourcesContent":["const createTagRegex = (title: string): RegExp => {\n const escapedTitle = title.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n return new RegExp(\n `(?:#\\\\[\\\\[${escapedTitle}\\\\]\\\\]|#${escapedTitle}(?!\\\\w)|\\\\[\\\\[${escapedTitle}\\\\]\\\\])`\n );\n};\nexport default createTagRegex;\n"]}