@adobe/helix-html-pipeline 3.6.0 → 3.6.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [3.6.2](https://github.com/adobe/helix-html-pipeline/compare/v3.6.1...v3.6.2) (2022-10-31)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update dependency github-slugger to v2 (main) ([#176](https://github.com/adobe/helix-html-pipeline/issues/176)) ([6bf6b58](https://github.com/adobe/helix-html-pipeline/commit/6bf6b588abdae6eb7584cb3ced7ee5d89a756be1))
7
+
8
+ ## [3.6.1](https://github.com/adobe/helix-html-pipeline/compare/v3.6.0...v3.6.1) (2022-10-31)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * don't rewrite production urls ([#175](https://github.com/adobe/helix-html-pipeline/issues/175)) ([815c154](https://github.com/adobe/helix-html-pipeline/commit/815c1545bc3e6f960ea320dc775e0edcf2bc414c)), closes [#165](https://github.com/adobe/helix-html-pipeline/issues/165)
14
+
1
15
  # [3.6.0](https://github.com/adobe/helix-html-pipeline/compare/v3.5.0...v3.6.0) (2022-10-27)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "3.6.0",
3
+ "version": "3.6.2",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -42,13 +42,13 @@
42
42
  "@adobe/helix-markdown-support": "5.0.10",
43
43
  "@adobe/helix-shared-utils": "2.1.0",
44
44
  "cookie": "0.5.0",
45
- "github-slugger": "1.4.0",
45
+ "github-slugger": "2.0.0",
46
46
  "hast-util-raw": "7.2.2",
47
47
  "hast-util-select": "5.0.2",
48
48
  "hast-util-to-html": "8.0.3",
49
49
  "hast-util-to-string": "2.0.0",
50
50
  "hastscript": "7.1.0",
51
- "jose": "4.10.3",
51
+ "jose": "4.10.4",
52
52
  "mdast-util-gfm-footnote": "1.0.1",
53
53
  "mdast-util-gfm-strikethrough": "1.0.1",
54
54
  "mdast-util-gfm-table": "1.0.6",
@@ -85,7 +85,7 @@
85
85
  "eslint-import-resolver-exports": "1.0.0-beta.3",
86
86
  "eslint-plugin-header": "3.1.1",
87
87
  "eslint-plugin-import": "2.26.0",
88
- "esmock": "2.0.6",
88
+ "esmock": "2.0.7",
89
89
  "husky": "8.0.1",
90
90
  "js-yaml": "4.1.0",
91
91
  "jsdom": "20.0.1",
@@ -175,19 +175,6 @@ export function getAbsoluteUrl(state, url) {
175
175
  return resolveUrl(`https://${state.config.host}/`, url);
176
176
  }
177
177
 
178
- /**
179
- * Checks if the given `str` matches any of the given regs or if `regs` is empty.
180
- * @param {RegExp[]} regs
181
- * @param {string} str
182
- * @returns {boolean} {@code true} if `regs` is empty or if `str` matches any of them.
183
- */
184
- function matchAny(regs, str) {
185
- if (!regs || regs.length === 0) {
186
- return true;
187
- }
188
- return regs.findIndex((r) => r.test(str)) >= 0;
189
- }
190
-
191
178
  /**
192
179
  * Rewrites the media, helix or external url. Returns the original if not rewritten.
193
180
  * @param {PipelineState} state
@@ -198,9 +185,7 @@ export function rewriteUrl(state, url) {
198
185
  if (!url || !url.startsWith('https://')) {
199
186
  return url;
200
187
  }
201
- const {
202
- host, pathname, search, hash,
203
- } = new URL(url);
188
+ const { pathname, search, hash } = new URL(url);
204
189
 
205
190
  if (AZURE_BLOB_REGEXP.test(url)) {
206
191
  const filename = pathname.split('/').pop();
@@ -221,12 +206,5 @@ export function rewriteUrl(state, url) {
221
206
  return `${pathname}${search}${hash}`;
222
207
  }
223
208
 
224
- if (host === state.config?.host && matchAny(state.config.routes, pathname)) {
225
- if (hash && pathname === state.info?.path) {
226
- return hash;
227
- }
228
- return `${pathname}${search}${hash}`;
229
- }
230
-
231
209
  return url;
232
210
  }
@@ -9,7 +9,7 @@
9
9
  * OF ANY KIND, either express or implied. See the License for the specific language
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
- import GithubSlugger from 'github-slugger';
12
+ import { slug } from 'github-slugger';
13
13
 
14
14
  export class IDSlugger {
15
15
  constructor() {
@@ -22,7 +22,7 @@ export class IDSlugger {
22
22
  * @return {string} A unique slug string
23
23
  */
24
24
  slug(value) {
25
- let id = GithubSlugger.slug(value)
25
+ let id = slug(value)
26
26
  // remove leading numbers
27
27
  .replace(/^\d+-+/, '');
28
28