@adobe/helix-html-pipeline 3.11.18 → 3.11.19

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,10 @@
1
+ ## [3.11.19](https://github.com/adobe/helix-html-pipeline/compare/v3.11.18...v3.11.19) (2023-07-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** use gfm from markdown-support ([3b27b20](https://github.com/adobe/helix-html-pipeline/commit/3b27b20fbe76eaeb6c1a8089a02440f43d614783))
7
+
1
8
  ## [3.11.18](https://github.com/adobe/helix-html-pipeline/compare/v3.11.17...v3.11.18) (2023-07-04)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "3.11.18",
3
+ "version": "3.11.19",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@adobe/helix-markdown-support": "6.1.3",
43
43
  "@adobe/helix-shared-utils": "3.0.0",
44
- "@adobe/mdast-util-gridtables": "1.0.9",
44
+ "@adobe/mdast-util-gridtables": "2.0.0",
45
45
  "@adobe/remark-gridtables": "1.0.4",
46
46
  "cookie": "0.5.0",
47
47
  "github-slugger": "2.0.0",
@@ -51,30 +51,20 @@
51
51
  "hast-util-to-string": "2.0.0",
52
52
  "hastscript": "7.2.0",
53
53
  "jose": "4.14.4",
54
- "mdast-util-gfm-footnote": "1.0.2",
55
- "mdast-util-gfm-strikethrough": "1.0.3",
56
- "mdast-util-gfm-table": "1.0.7",
57
- "mdast-util-gfm-task-list-item": "1.0.2",
58
54
  "mdast-util-to-hast": "12.3.0",
59
- "mdast-util-to-string": "3.2.0",
60
- "micromark-extension-gfm-footnote": "1.1.2",
61
- "micromark-extension-gfm-strikethrough": "1.0.7",
62
- "micromark-extension-gfm-table": "1.0.7",
63
- "micromark-extension-gfm-tagfilter": "1.0.2",
64
- "micromark-extension-gfm-task-list-item": "1.0.5",
65
- "micromark-util-combine-extensions": "1.1.0",
55
+ "mdast-util-to-string": "4.0.0",
66
56
  "mime": "3.0.0",
67
57
  "rehype-format": "4.0.1",
68
58
  "rehype-parse": "8.0.4",
69
59
  "remark-parse": "10.0.2",
70
60
  "strip-markdown": "5.0.1",
71
61
  "unified": "10.1.2",
72
- "unist-util-map": "3.1.3",
73
- "unist-util-remove": "3.1.1",
74
- "unist-util-remove-position": "4.0.2",
75
- "unist-util-select": "4.0.3",
76
- "unist-util-visit": "4.1.2",
77
- "unist-util-visit-parents": "5.1.3"
62
+ "unist-util-map": "4.0.0",
63
+ "unist-util-remove": "4.0.0",
64
+ "unist-util-remove-position": "5.0.0",
65
+ "unist-util-select": "5.0.0",
66
+ "unist-util-visit": "5.0.0",
67
+ "unist-util-visit-parents": "6.0.1"
78
68
  },
79
69
  "devDependencies": {
80
70
  "@adobe/eslint-config-helix": "2.0.2",
@@ -95,8 +85,7 @@
95
85
  "lint-staged": "13.2.3",
96
86
  "mocha": "10.2.0",
97
87
  "mocha-multi-reporters": "1.5.1",
98
- "remark-gfm": "3.0.1",
99
- "semantic-release": "21.0.6"
88
+ "semantic-release": "21.0.7"
100
89
  },
101
90
  "lint-staged": {
102
91
  "*.js": "eslint",
@@ -12,10 +12,9 @@
12
12
  import { unified } from 'unified';
13
13
  import remarkParse from 'remark-parse';
14
14
  import { removePosition } from 'unist-util-remove-position';
15
- import { dereference } from '@adobe/helix-markdown-support';
15
+ import { dereference, remarkGfmNoLink } from '@adobe/helix-markdown-support';
16
16
  import { remarkMatter } from '@adobe/helix-markdown-support/matter';
17
17
  import remarkGridTable from '@adobe/remark-gridtables';
18
- import remarkGfm from '../utils/remark-gfm-nolink.js';
19
18
 
20
19
  export class FrontmatterParsingError extends Error {
21
20
  }
@@ -32,7 +31,7 @@ export default function parseMarkdown(state) {
32
31
  const converted = content.data.replace(/(\r\n|\n|\r)/gm, '\n');
33
32
  content.mdast = unified()
34
33
  .use(remarkParse)
35
- .use(remarkGfm)
34
+ .use(remarkGfmNoLink)
36
35
  .use(remarkMatter, {
37
36
  errorHandler: (e) => {
38
37
  log.warn(new FrontmatterParsingError(e));
@@ -41,6 +40,6 @@ export default function parseMarkdown(state) {
41
40
  .use(remarkGridTable)
42
41
  .parse(converted);
43
42
 
44
- removePosition(content.mdast, true);
43
+ removePosition(content.mdast, { force: true });
45
44
  dereference(content.mdast);
46
45
  }
@@ -1,93 +0,0 @@
1
- /*
2
- * Copyright 2021 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
-
13
- /*
14
- copied from
15
- https://github.com/micromark/micromark-extension-gfm/blob/7bc6b6f3baf941f877d7b2111e9257b21b13b37e/index.js
16
-
17
- (The MIT License)
18
-
19
- Copyright (c) 2020 Titus Wormer <tituswormer@gmail.com>
20
-
21
- Permission is hereby granted, free of charge, to any person obtaining
22
- a copy of this software and associated documentation files (the
23
- 'Software'), to deal in the Software without restriction, including
24
- without limitation the rights to use, copy, modify, merge, publish,
25
- distribute, sublicense, and/or sell copies of the Software, and to
26
- permit persons to whom the Software is furnished to do so, subject to
27
- the following conditions:
28
-
29
- The above copyright notice and this permission notice shall be
30
- included in all copies or substantial portions of the Software.
31
-
32
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
33
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
35
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
36
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
37
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
38
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39
- */
40
-
41
- /**
42
- * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
43
- * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
44
- *
45
- * @typedef {import('mdast-util-gfm-table').Options} Options
46
- */
47
-
48
- // import {
49
- // gfmAutolinkLiteralFromMarkdown,
50
- // gfmAutolinkLiteralToMarkdown
51
- // } from 'mdast-util-gfm-autolink-literal'
52
- import {
53
- gfmFootnoteFromMarkdown,
54
- gfmFootnoteToMarkdown,
55
- } from 'mdast-util-gfm-footnote';
56
- import {
57
- gfmStrikethroughFromMarkdown,
58
- gfmStrikethroughToMarkdown,
59
- } from 'mdast-util-gfm-strikethrough';
60
- import { gfmTableFromMarkdown, gfmTableToMarkdown } from 'mdast-util-gfm-table';
61
- import {
62
- gfmTaskListItemFromMarkdown,
63
- gfmTaskListItemToMarkdown,
64
- } from 'mdast-util-gfm-task-list-item';
65
-
66
- /**
67
- * @returns {Array.<FromMarkdownExtension>}
68
- */
69
- export function gfmFromMarkdown() {
70
- return [
71
- gfmFootnoteFromMarkdown(),
72
- gfmStrikethroughFromMarkdown,
73
- gfmTableFromMarkdown,
74
- // gfmAutolinkLiteralFromMarkdown,
75
- gfmTaskListItemFromMarkdown,
76
- ];
77
- }
78
-
79
- /**
80
- * @param {Options} [options]
81
- * @returns {ToMarkdownExtension}
82
- */
83
- export function gfmToMarkdown(options) {
84
- return {
85
- extensions: [
86
- // gfmAutolinkLiteralToMarkdown,
87
- gfmFootnoteToMarkdown(),
88
- gfmStrikethroughToMarkdown,
89
- gfmTableToMarkdown(options),
90
- gfmTaskListItemToMarkdown,
91
- ],
92
- };
93
- }
@@ -1,128 +0,0 @@
1
- /*
2
- * Copyright 2021 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
-
13
- /*
14
- copied from
15
- https://github.com/syntax-tree/mdast-util-gfm/blob/544cc04ef9980fe152090bf68338444b1ed0e7a4/index.js
16
-
17
- (The MIT License)
18
-
19
- Copyright (c) 2020 Titus Wormer <tituswormer@gmail.com>
20
-
21
- Permission is hereby granted, free of charge, to any person obtaining
22
- a copy of this software and associated documentation files (the
23
- 'Software'), to deal in the Software without restriction, including
24
- without limitation the rights to use, copy, modify, merge, publish,
25
- distribute, sublicense, and/or sell copies of the Software, and to
26
- permit persons to whom the Software is furnished to do so, subject to
27
- the following conditions:
28
-
29
- The above copyright notice and this permission notice shall be
30
- included in all copies or substantial portions of the Software.
31
-
32
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
33
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
35
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
36
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
37
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
38
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39
- */
40
-
41
- /* eslint-disable no-unused-vars */
42
-
43
- /**
44
- * @typedef {import('micromark-util-types').Extension} Extension
45
- * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
46
- * @typedef {import('micromark-extension-gfm-strikethrough').Options} Options
47
- * @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions
48
- */
49
-
50
- import {
51
- combineExtensions,
52
- } from 'micromark-util-combine-extensions';
53
- // import {
54
- // gfmAutolinkLiteral,
55
- // gfmAutolinkLiteralHtml
56
- // } from 'micromark-extension-gfm-autolink-literal'
57
- import { gfmFootnote, gfmFootnoteHtml } from 'micromark-extension-gfm-footnote';
58
- import {
59
- gfmStrikethrough,
60
- gfmStrikethroughHtml,
61
- } from 'micromark-extension-gfm-strikethrough';
62
- import { gfmTable, gfmTableHtml } from 'micromark-extension-gfm-table';
63
- import { gfmTagfilterHtml } from 'micromark-extension-gfm-tagfilter';
64
- import {
65
- gfmTaskListItem,
66
- gfmTaskListItemHtml,
67
- } from 'micromark-extension-gfm-task-list-item';
68
- import { gfmFromMarkdown, gfmToMarkdown } from './mdast-util-gfm-nolink.js';
69
-
70
- /**
71
- * Support GFM or markdown on github.com.
72
- *
73
- * @param {Options} [options]
74
- * @returns {Extension}
75
- */
76
- export function gfm(options) {
77
- return combineExtensions([
78
- // gfmAutolinkLiteral,
79
- gfmFootnote(),
80
- gfmStrikethrough(options),
81
- gfmTable,
82
- gfmTaskListItem,
83
- ]);
84
- }
85
-
86
- /**
87
- * Support to compile GFM to HTML.
88
- *
89
- * @param {HtmlOptions} [options]
90
- * @returns {HtmlExtension}
91
- */
92
- // export function gfmHtml(options) {
93
- // return combineHtmlExtensions([
94
- // // gfmAutolinkLiteralHtml,
95
- // gfmFootnoteHtml(options),
96
- // gfmStrikethroughHtml,
97
- // gfmTableHtml,
98
- // gfmTagfilterHtml,
99
- // gfmTaskListItemHtml,
100
- // ]);
101
- // }
102
-
103
- /**
104
- * Plugin to support GFM (autolink literals, footnotes, strikethrough, tables, tasklists).
105
- *
106
- * @type {import('unified').Plugin<[Options?]|void[], Root>}
107
- */
108
- export default function remarkGfm(options = {}) {
109
- const data = this.data();
110
-
111
- /**
112
- * @param {string} field
113
- * @param {unknown} value
114
- */
115
- function add(field, value) {
116
- const list = /** @type {unknown[]} */ (
117
- // Other extensions
118
- /* c8 ignore next 2 */
119
- data[field] ? data[field] : (data[field] = [])
120
- );
121
-
122
- list.push(value);
123
- }
124
-
125
- add('micromarkExtensions', gfm(options));
126
- add('fromMarkdownExtensions', gfmFromMarkdown());
127
- add('toMarkdownExtensions', gfmToMarkdown(options));
128
- }