@tryghost/mg-linkfixer 0.16.0 → 0.16.1

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.
Files changed (2) hide show
  1. package/lib/LinkFixer.js +3 -2
  2. package/package.json +5 -4
package/lib/LinkFixer.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import {domUtils, stringUtils} from '@tryghost/mg-utils';
2
+ import escapeStringRegexp from 'escape-string-regexp';
2
3
 
3
4
  const {processFragment} = domUtils;
4
5
  const {cleanURL} = stringUtils;
@@ -57,10 +58,10 @@ export default class LinkFixer {
57
58
  const siteURL = new URL(postURLDomain.origin);
58
59
 
59
60
  siteURL.protocol = 'http:';
60
- const siteURLHttp = siteURL.toString().replace(/\/$/, '');
61
+ const siteURLHttp = escapeStringRegexp(siteURL.toString().replace(/\/$/, ''));
61
62
 
62
63
  siteURL.protocol = 'https:';
63
- const siteURLHttps = siteURL.toString().replace(/\/$/, '');
64
+ const siteURLHttps = escapeStringRegexp(siteURL.toString().replace(/\/$/, ''));
64
65
 
65
66
  const siteURLBothProtocols = `(?:${siteURLHttp}|${siteURLHttps})`;
66
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/mg-linkfixer",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/TryGhost/migrate.git",
@@ -19,11 +19,12 @@
19
19
  },
20
20
  "devDependencies": {
21
21
  "eslint": "8.57.1",
22
- "@tryghost/mg-json": "0.22.0",
23
- "@tryghost/listr-smart-renderer": "0.15.0"
22
+ "@tryghost/mg-json": "0.22.1",
23
+ "@tryghost/listr-smart-renderer": "0.15.1"
24
24
  },
25
25
  "dependencies": {
26
- "@tryghost/mg-utils": "0.11.0"
26
+ "escape-string-regexp": "5.0.0",
27
+ "@tryghost/mg-utils": "0.11.1"
27
28
  },
28
29
  "scripts": {
29
30
  "dev": "echo \"Implement me!\"",