@adobe/helix-markdown-support 6.3.1 → 7.1.0

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.
@@ -2,10 +2,10 @@ version: 2.1
2
2
  executors:
3
3
  node18:
4
4
  docker:
5
- - image: cimg/node:18.17
5
+ - image: cimg/node:18.18
6
6
 
7
7
  orbs:
8
- codecov: codecov/codecov@3.2.5
8
+ codecov: codecov/codecov@3.3.0
9
9
 
10
10
  commands:
11
11
  setup:
@@ -9,7 +9,7 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  if: "!contains(github.event.head_commit.message, '[skip ci]')"
11
11
  steps:
12
- - uses: actions/checkout@v3
12
+ - uses: actions/checkout@v4
13
13
  - name: Use Node.js 18.x
14
14
  uses: actions/setup-node@v3
15
15
  with:
package/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ # [7.1.0](https://github.com/adobe/helix-markdown-support/compare/v7.0.0...v7.1.0) (2023-10-02)
2
+
3
+
4
+ ### Features
5
+
6
+ * **deps:** update external major ([#220](https://github.com/adobe/helix-markdown-support/issues/220)) ([1c1194d](https://github.com/adobe/helix-markdown-support/commit/1c1194d838da30ec9e5689b9c1168f4ac6bd63a5))
7
+
8
+ # [7.0.0](https://github.com/adobe/helix-markdown-support/compare/v6.3.1...v7.0.0) (2023-09-26)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update micromark to 4.x ([f651a31](https://github.com/adobe/helix-markdown-support/commit/f651a3176c0458af230f8145cc3caa21a5e282f7))
14
+
15
+
16
+ ### BREAKING CHANGES
17
+
18
+ * **deps:** micromark 4.x required
19
+
1
20
  ## [6.3.1](https://github.com/adobe/helix-markdown-support/compare/v6.3.0...v6.3.1) (2023-08-24)
2
21
 
3
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-markdown-support",
3
- "version": "6.3.1",
3
+ "version": "7.1.0",
4
4
  "description": "Helix Markdown Support",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -25,24 +25,24 @@
25
25
  "./matter": "./src/matter/index.js"
26
26
  },
27
27
  "dependencies": {
28
- "hast-util-to-html": "8.0.4",
28
+ "hast-util-to-html": "9.0.0",
29
29
  "js-yaml": "4.1.0",
30
- "mdast-util-gfm-footnote": "1.0.2",
31
- "mdast-util-gfm-strikethrough": "1.0.3",
32
- "mdast-util-gfm-table": "1.0.7",
33
- "mdast-util-gfm-task-list-item": "1.0.2",
34
- "mdast-util-phrasing": "3.0.1",
35
- "mdast-util-to-hast": "12.3.0",
36
- "micromark-extension-gfm-footnote": "1.1.2",
37
- "micromark-extension-gfm-strikethrough": "1.0.7",
38
- "micromark-extension-gfm-table": "1.0.7",
39
- "micromark-extension-gfm-tagfilter": "1.0.2",
40
- "micromark-extension-gfm-task-list-item": "1.0.5",
41
- "micromark-util-character": "1.2.0",
42
- "micromark-util-combine-extensions": "1.1.0",
43
- "micromark-util-symbol": "1.1.0",
44
- "unist-util-find": "1.0.4",
45
- "unist-util-visit": "4.1.2"
30
+ "mdast-util-gfm-footnote": "2.0.0",
31
+ "mdast-util-gfm-strikethrough": "2.0.0",
32
+ "mdast-util-gfm-table": "2.0.0",
33
+ "mdast-util-gfm-task-list-item": "2.0.0",
34
+ "mdast-util-phrasing": "4.0.0",
35
+ "mdast-util-to-hast": "13.0.2",
36
+ "micromark-extension-gfm-footnote": "2.0.0",
37
+ "micromark-extension-gfm-strikethrough": "2.0.0",
38
+ "micromark-extension-gfm-table": "2.0.0",
39
+ "micromark-extension-gfm-tagfilter": "2.0.0",
40
+ "micromark-extension-gfm-task-list-item": "2.0.1",
41
+ "micromark-util-character": "2.0.1",
42
+ "micromark-util-combine-extensions": "2.0.0",
43
+ "micromark-util-symbol": "2.0.0",
44
+ "unist-util-find": "3.0.0",
45
+ "unist-util-visit": "5.0.0"
46
46
  },
47
47
  "mocha": {
48
48
  "spec": "test/**/*.test.js",
@@ -52,33 +52,33 @@
52
52
  "node-option": "conditions=development"
53
53
  },
54
54
  "peerDependencies": {
55
- "unified": "10.x"
55
+ "unified": "11.x"
56
56
  },
57
57
  "engines": {
58
58
  "node": ">=14"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@adobe/eslint-config-helix": "2.0.3",
62
- "@adobe/remark-gridtables": "1.0.4",
62
+ "@adobe/remark-gridtables": "2.0.1",
63
63
  "@semantic-release/changelog": "6.0.3",
64
64
  "@semantic-release/git": "10.0.1",
65
65
  "c8": "8.0.1",
66
- "eslint": "8.47.0",
66
+ "eslint": "8.50.0",
67
67
  "husky": "8.0.3",
68
68
  "junit-report-builder": "3.0.1",
69
- "lint-staged": "13.3.0",
69
+ "lint-staged": "14.0.1",
70
70
  "mdast-builder": "1.1.1",
71
71
  "mocha": "10.2.0",
72
72
  "mocha-multi-reporters": "1.5.1",
73
- "rehype-format": "4.0.1",
74
- "rehype-stringify": "9.0.4",
75
- "remark-gfm": "3.0.1",
76
- "remark-parse": "10.0.2",
77
- "remark-rehype": "10.1.0",
78
- "remark-stringify": "10.0.3",
79
- "semantic-release": "21.0.7",
80
- "unified": "10.1.2",
81
- "unist-util-inspect": "7.0.2"
73
+ "rehype-format": "5.0.0",
74
+ "rehype-stringify": "10.0.0",
75
+ "remark-gfm": "4.0.0",
76
+ "remark-parse": "11.0.0",
77
+ "remark-rehype": "11.0.0",
78
+ "remark-stringify": "11.0.0",
79
+ "semantic-release": "22.0.5",
80
+ "unified": "11.0.3",
81
+ "unist-util-inspect": "8.0.0"
82
82
  },
83
83
  "lint-staged": {
84
84
  "*.js": "eslint"
@@ -20,7 +20,7 @@ function open(token) {
20
20
  function createClose(options) {
21
21
  function close(token) {
22
22
  const data = this.resume();
23
- const node = this.exit(token);
23
+ const node = this.stack[this.stack.length - 1];
24
24
  // todo: avoid double parsing
25
25
  node.payload = jsYaml.load(data);
26
26
  if (options.yamlDump) {
@@ -28,6 +28,7 @@ function createClose(options) {
28
28
  } else {
29
29
  delete node.value;
30
30
  }
31
+ this.exit(token);
31
32
  }
32
33
 
33
34
  return close;
@@ -11,8 +11,7 @@
11
11
  */
12
12
  /* eslint-disable no-use-before-define */
13
13
  import jsYaml from 'js-yaml';
14
- import { codes } from 'micromark-util-symbol/codes.js';
15
- import { types } from 'micromark-util-symbol/types.js';
14
+ import { codes, types } from 'micromark-util-symbol';
16
15
  import { markdownLineEnding, markdownSpace } from 'micromark-util-character';
17
16
  import { TYPE_YAML } from './types.js';
18
17
 
@@ -10,7 +10,7 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
  import { visit, CONTINUE } from 'unist-util-visit';
13
- import find from 'unist-util-find';
13
+ import { find } from 'unist-util-find';
14
14
 
15
15
  /**
16
16
  * Sanitizes links:
@@ -12,37 +12,17 @@
12
12
 
13
13
  /*
14
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
- */
15
+ https://github.com/syntax-tree/mdast-util-gfm/blob/main/lib/index.js
16
+ */
40
17
 
41
18
  /**
42
19
  * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
43
20
  * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
44
- *
21
+ */
22
+
23
+ /**
45
24
  * @typedef {import('mdast-util-gfm-table').Options} Options
25
+ * Configuration.
46
26
  */
47
27
 
48
28
  // import {
@@ -64,30 +44,41 @@ import {
64
44
  } from 'mdast-util-gfm-task-list-item';
65
45
 
66
46
  /**
67
- * @returns {Array.<FromMarkdownExtension>}
47
+ * Create an extension for `mdast-util-from-markdown` to enable GFM (autolink
48
+ * literals, footnotes, strikethrough, tables, tasklists).
49
+ *
50
+ * @returns {Array<FromMarkdownExtension>}
51
+ * Extension for `mdast-util-from-markdown` to enable GFM (autolink literals,
52
+ * footnotes, strikethrough, tables, tasklists).
68
53
  */
69
54
  export function gfmFromMarkdown() {
70
55
  return [
56
+ // gfmAutolinkLiteralFromMarkdown(),
71
57
  gfmFootnoteFromMarkdown(),
72
- gfmStrikethroughFromMarkdown,
73
- gfmTableFromMarkdown,
74
- // gfmAutolinkLiteralFromMarkdown,
75
- gfmTaskListItemFromMarkdown,
58
+ gfmStrikethroughFromMarkdown(),
59
+ gfmTableFromMarkdown(),
60
+ gfmTaskListItemFromMarkdown(),
76
61
  ];
77
62
  }
78
63
 
79
64
  /**
80
- * @param {Options} [options]
65
+ * Create an extension for `mdast-util-to-markdown` to enable GFM (autolink
66
+ * literals, footnotes, strikethrough, tables, tasklists).
67
+ *
68
+ * @param {Options | null | undefined} [options]
69
+ * Configuration.
81
70
  * @returns {ToMarkdownExtension}
71
+ * Extension for `mdast-util-to-markdown` to enable GFM (autolink literals,
72
+ * footnotes, strikethrough, tables, tasklists).
82
73
  */
83
74
  export function gfmToMarkdown(options) {
84
75
  return {
85
76
  extensions: [
86
- // gfmAutolinkLiteralToMarkdown,
77
+ // gfmAutolinkLiteralToMarkdown(),
87
78
  gfmFootnoteToMarkdown(),
88
- gfmStrikethroughToMarkdown,
79
+ gfmStrikethroughToMarkdown(),
89
80
  gfmTableToMarkdown(options),
90
- gfmTaskListItemToMarkdown,
81
+ gfmTaskListItemToMarkdown(),
91
82
  ],
92
83
  };
93
84
  }
@@ -12,37 +12,14 @@
12
12
 
13
13
  /*
14
14
  copied from
15
- https://github.com/micromark/micromark-extension-gfm/blob/942585eba9ec22fd9818638d42a7c8e62a7208b0/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
- */
15
+ https://github.com/micromark/micromark-extension-gfm/blob/main/index.js
16
+ */
40
17
 
41
18
  /**
19
+ * @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions
20
+ * @typedef {import('micromark-extension-gfm-strikethrough').Options} Options
42
21
  * @typedef {import('micromark-util-types').Extension} Extension
43
22
  * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
44
- * @typedef {import('micromark-extension-gfm-strikethrough').Options} Options
45
- * @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions
46
23
  */
47
24
 
48
25
  import {
@@ -51,8 +28,8 @@ import {
51
28
  } from 'micromark-util-combine-extensions';
52
29
  // import {
53
30
  // gfmAutolinkLiteral,
54
- // gfmAutolinkLiteralHtml,
55
- // } from 'micromark-extension-gfm-autolink-literal';
31
+ // gfmAutolinkLiteralHtml
32
+ // } from 'micromark-extension-gfm-autolink-literal'
56
33
  import { gfmFootnote, gfmFootnoteHtml } from 'micromark-extension-gfm-footnote';
57
34
  import {
58
35
  gfmStrikethrough,
@@ -66,47 +43,45 @@ import {
66
43
  } from 'micromark-extension-gfm-task-list-item';
67
44
 
68
45
  /**
69
- * Add support for parsing GFM in markdown.
70
- *
71
- * Function that can be called to get a syntax extension for micromark (passed
72
- * in `extensions`).
46
+ * Create an extension for `micromark` to enable GFM syntax.
73
47
  *
74
- * @param {Options} [options]
48
+ * @param {Options | null | undefined} [options]
75
49
  * Configuration (optional).
50
+ *
76
51
  * Passed to `micromark-extens-gfm-strikethrough`.
77
52
  * @returns {Extension}
78
- * Syntax extension for micromark (passed in `extensions`).
53
+ * Extension for `micromark` that can be passed in `extensions` to enable GFM
54
+ * syntax.
79
55
  */
80
56
  export function gfm(options) {
81
57
  return combineExtensions([
82
- // gfmAutolinkLiteral,
58
+ // gfmAutolinkLiteral(),
83
59
  gfmFootnote(),
84
60
  gfmStrikethrough(options),
85
- gfmTable,
86
- gfmTaskListItem,
61
+ gfmTable(),
62
+ gfmTaskListItem(),
87
63
  ]);
88
64
  }
89
65
 
90
66
  /**
91
- * Add support for turning GFM in markdown to HTML.
92
- *
93
- * Function that can be called to get an HTML extension for micromark (passed
94
- * in `htmlExtensions`).
67
+ * Create an extension for `micromark` to support GFM when serializing to HTML.
95
68
  *
96
- * @param {HtmlOptions} [options]
69
+ * @param {HtmlOptions | null | undefined} [options]
97
70
  * Configuration (optional).
71
+ *
98
72
  * Passed to `micromark-extens-gfm-footnote`.
99
73
  * @returns {HtmlExtension}
100
- * HTML extension for micromark (passed in `htmlExtensions`).
74
+ * Extension for `micromark` that can be passed in `htmlExtensions` to
75
+ * support GFM when serializing to HTML.
101
76
  */
102
77
  /* c8 ignore next 10 */
103
78
  export function gfmHtml(options) {
104
79
  return combineHtmlExtensions([
105
- // gfmAutolinkLiteralHtml,
80
+ // gfmAutolinkLiteralHtml(),
106
81
  gfmFootnoteHtml(options),
107
- gfmStrikethroughHtml,
108
- gfmTableHtml,
109
- gfmTagfilterHtml,
110
- gfmTaskListItemHtml,
82
+ gfmStrikethroughHtml(),
83
+ gfmTableHtml(),
84
+ gfmTagfilterHtml(),
85
+ gfmTaskListItemHtml(),
111
86
  ]);
112
87
  }