@adobe/helix-markdown-support 6.1.3 → 6.2.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [6.2.0](https://github.com/adobe/helix-markdown-support/compare/v6.1.3...v6.2.0) (2023-07-18)
2
+
3
+
4
+ ### Features
5
+
6
+ * support extended formats ([b1561dd](https://github.com/adobe/helix-markdown-support/commit/b1561ddfc13ddd8aae22a6f396d2d956afcd0a09))
7
+
1
8
  ## [6.1.3](https://github.com/adobe/helix-markdown-support/compare/v6.1.2...v6.1.3) (2023-06-27)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-markdown-support",
3
- "version": "6.1.3",
3
+ "version": "6.2.0",
4
4
  "description": "Helix Markdown Support",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -41,7 +41,7 @@
41
41
  "micromark-util-character": "1.2.0",
42
42
  "micromark-util-combine-extensions": "1.1.0",
43
43
  "micromark-util-symbol": "1.1.0",
44
- "unist-util-find": "1.0.3",
44
+ "unist-util-find": "1.0.4",
45
45
  "unist-util-visit": "4.1.2"
46
46
  },
47
47
  "mocha": {
@@ -59,14 +59,14 @@
59
59
  },
60
60
  "devDependencies": {
61
61
  "@adobe/eslint-config-helix": "2.0.2",
62
- "@adobe/remark-gridtables": "1.0.3",
62
+ "@adobe/remark-gridtables": "1.0.4",
63
63
  "@semantic-release/changelog": "6.0.3",
64
64
  "@semantic-release/git": "10.0.1",
65
65
  "c8": "8.0.0",
66
- "eslint": "8.43.0",
66
+ "eslint": "8.45.0",
67
67
  "husky": "8.0.3",
68
68
  "junit-report-builder": "3.0.1",
69
- "lint-staged": "13.2.2",
69
+ "lint-staged": "13.2.3",
70
70
  "mdast-builder": "1.1.1",
71
71
  "mocha": "10.2.0",
72
72
  "mocha-multi-reporters": "1.5.1",
@@ -76,7 +76,7 @@
76
76
  "remark-parse": "10.0.2",
77
77
  "remark-rehype": "10.1.0",
78
78
  "remark-stringify": "10.0.3",
79
- "semantic-release": "21.0.5",
79
+ "semantic-release": "21.0.7",
80
80
  "unified": "10.1.2",
81
81
  "unist-util-inspect": "7.0.2"
82
82
  },
@@ -10,6 +10,7 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
  import { visit, CONTINUE } from 'unist-util-visit';
13
+ import { isFormat } from './mdast-sanitize-text-and-formats.js';
13
14
 
14
15
  /**
15
16
  * Sanitizes text:
@@ -23,7 +24,7 @@ export default function sanitizeFormats(tree) {
23
24
  visit(tree, (node, index, parent) => {
24
25
  const { children: siblings = [] } = parent || {};
25
26
  const { children } = node;
26
- if (node.type === 'strong' || node.type === 'emphasis' || node.type === 'delete') {
27
+ if (isFormat(node.type)) {
27
28
  // remove empty nodes
28
29
  if (!children || !children.length) {
29
30
  siblings.splice(index, 1);
@@ -12,8 +12,13 @@
12
12
  import { visit, CONTINUE } from 'unist-util-visit';
13
13
  import { asciiPunctuation, markdownSpace, unicodePunctuation } from 'micromark-util-character';
14
14
 
15
- function isFormat(type) {
16
- return type === 'strong' || type === 'emphasis' || type === 'delete';
15
+ export function isFormat(type) {
16
+ return type === 'strong'
17
+ || type === 'emphasis'
18
+ || type === 'delete'
19
+ || type === 'superscript'
20
+ || type === 'subscript'
21
+ || type === 'underline';
17
22
  }
18
23
 
19
24
  /**