@adobe/helix-markdown-support 7.1.12 → 7.1.14
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.
|
@@ -10,11 +10,11 @@ jobs:
|
|
|
10
10
|
name: Test
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
12
|
steps:
|
|
13
|
-
- uses: actions/checkout@
|
|
13
|
+
- uses: actions/checkout@v5
|
|
14
14
|
- name: Use Node.js 20.x
|
|
15
|
-
uses: actions/setup-node@
|
|
15
|
+
uses: actions/setup-node@v5
|
|
16
16
|
with:
|
|
17
|
-
node-version: '
|
|
17
|
+
node-version: '22.x'
|
|
18
18
|
- run: npm ci
|
|
19
19
|
- run: npm run lint
|
|
20
20
|
- run: npm test
|
|
@@ -33,11 +33,11 @@ jobs:
|
|
|
33
33
|
needs: test
|
|
34
34
|
if: github.ref == 'refs/heads/main'
|
|
35
35
|
steps:
|
|
36
|
-
- uses: actions/checkout@
|
|
36
|
+
- uses: actions/checkout@v5
|
|
37
37
|
- name: Use Node.js 20.x
|
|
38
|
-
uses: actions/setup-node@
|
|
38
|
+
uses: actions/setup-node@v5
|
|
39
39
|
with:
|
|
40
|
-
node-version: '
|
|
40
|
+
node-version: '22.x'
|
|
41
41
|
- run: npm ci
|
|
42
42
|
- run: npm run semantic-release
|
|
43
43
|
env:
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [7.1.14](https://github.com/adobe/helix-markdown-support/compare/v7.1.13...v7.1.14) (2025-10-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* allow snug em and strong ([#337](https://github.com/adobe/helix-markdown-support/issues/337)) ([921bdf4](https://github.com/adobe/helix-markdown-support/commit/921bdf4a4b046abed9d00f4cc1bb91cf6804b5ec))
|
|
7
|
+
|
|
8
|
+
## [7.1.13](https://github.com/adobe/helix-markdown-support/compare/v7.1.12...v7.1.13) (2025-10-06)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* use * for emphasis ([#334](https://github.com/adobe/helix-markdown-support/issues/334)) ([2c4c336](https://github.com/adobe/helix-markdown-support/commit/2c4c3369daa205a414f79820590e74be82cdec2c))
|
|
14
|
+
|
|
1
15
|
## [7.1.12](https://github.com/adobe/helix-markdown-support/compare/v7.1.11...v7.1.12) (2025-02-24)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2025 Adobe. All rights reserved.
|
|
3
3
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
5
|
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
@@ -9,8 +9,24 @@
|
|
|
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 { defineConfig, globalIgnores } from '@eslint/config-helpers'
|
|
13
|
+
import { recommended, source, test } from '@adobe/eslint-config-helix';
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
export default defineConfig([
|
|
16
|
+
globalIgnores([
|
|
17
|
+
'.vscode/*',
|
|
18
|
+
'coverage/*',
|
|
19
|
+
]),
|
|
20
|
+
{
|
|
21
|
+
rules: {
|
|
22
|
+
// see https://github.com/import-js/eslint-plugin-import/issues/1868
|
|
23
|
+
'import/no-unresolved': ['error', { ignore: ['micromark-util-symbol'] }],
|
|
24
|
+
},
|
|
25
|
+
plugins: {
|
|
26
|
+
import: recommended.plugins.import,
|
|
27
|
+
},
|
|
28
|
+
extends: [recommended],
|
|
29
|
+
},
|
|
30
|
+
source,
|
|
31
|
+
test,
|
|
32
|
+
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-markdown-support",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.14",
|
|
4
4
|
"description": "Helix Markdown Support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -59,25 +59,26 @@
|
|
|
59
59
|
"node": ">=14"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@adobe/eslint-config-helix": "
|
|
63
|
-
"@adobe/remark-gridtables": "3.0.
|
|
62
|
+
"@adobe/eslint-config-helix": "3.0.11",
|
|
63
|
+
"@adobe/remark-gridtables": "3.0.15",
|
|
64
|
+
"@eslint/config-helpers": "0.4.0",
|
|
64
65
|
"@semantic-release/changelog": "6.0.3",
|
|
65
66
|
"@semantic-release/git": "10.0.1",
|
|
66
67
|
"c8": "10.1.3",
|
|
67
|
-
"eslint": "
|
|
68
|
+
"eslint": "9.4.0",
|
|
68
69
|
"husky": "9.1.7",
|
|
69
70
|
"junit-report-builder": "5.1.1",
|
|
70
|
-
"lint-staged": "
|
|
71
|
+
"lint-staged": "16.2.3",
|
|
71
72
|
"mdast-builder": "1.1.1",
|
|
72
|
-
"mocha": "11.
|
|
73
|
+
"mocha": "11.7.2",
|
|
73
74
|
"mocha-multi-reporters": "1.5.1",
|
|
74
75
|
"rehype-format": "5.0.1",
|
|
75
76
|
"rehype-stringify": "10.0.1",
|
|
76
77
|
"remark-gfm": "4.0.1",
|
|
77
78
|
"remark-parse": "11.0.0",
|
|
78
|
-
"remark-rehype": "11.1.
|
|
79
|
+
"remark-rehype": "11.1.2",
|
|
79
80
|
"remark-stringify": "11.0.0",
|
|
80
|
-
"semantic-release": "24.2.
|
|
81
|
+
"semantic-release": "24.2.9",
|
|
81
82
|
"unified": "11.0.5",
|
|
82
83
|
"unist-util-inspect": "8.1.0"
|
|
83
84
|
},
|
|
@@ -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 {
|
|
13
|
+
import { markdownSpace, unicodePunctuation } from 'micromark-util-character';
|
|
14
14
|
|
|
15
15
|
export function isFormat(type) {
|
|
16
16
|
return type === 'strong'
|
|
@@ -95,6 +95,12 @@ function collapse(tree) {
|
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
/**
|
|
99
|
+
* handles whitespace in formats:
|
|
100
|
+
* - move all whitespaces into the surrounding text
|
|
101
|
+
*
|
|
102
|
+
* @param tree
|
|
103
|
+
*/
|
|
98
104
|
function whitespace(tree) {
|
|
99
105
|
visit(tree, (node, index, parent) => {
|
|
100
106
|
const { children: siblings = [] } = parent || {};
|
|
@@ -151,20 +157,16 @@ function whitespace(tree) {
|
|
|
151
157
|
}
|
|
152
158
|
}
|
|
153
159
|
|
|
154
|
-
// ensure that text
|
|
160
|
+
// ensure that text has surrounding whitespace if both sides are "trapped"
|
|
161
|
+
// eg: foo**bar**zoo -> foo **bar** zoo
|
|
155
162
|
const prev = siblings[index - 1];
|
|
156
|
-
if (prev?.type === 'text' && !isSnug(node.type)) {
|
|
157
|
-
const code = prev.value.charCodeAt(prev.value.length - 1);
|
|
158
|
-
if (!asciiPunctuation(code) && !markdownSpace(code) && !unicodePunctuation(code)) {
|
|
159
|
-
prev.value += ' ';
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// ensure that text after format has leading whitespace
|
|
164
163
|
const next = siblings[index + 1];
|
|
165
|
-
if (
|
|
166
|
-
const
|
|
167
|
-
|
|
164
|
+
if (prev?.type === 'text' && next?.type === 'text' && !isSnug(node.type)) {
|
|
165
|
+
const ws = (code) => markdownSpace(code) || unicodePunctuation(code);
|
|
166
|
+
const prevCode = prev.value.charCodeAt(prev.value.length - 1);
|
|
167
|
+
const nextCode = next.value.charCodeAt(0);
|
|
168
|
+
if (!ws(prevCode) && !ws(nextCode)) {
|
|
169
|
+
prev.value += ' ';
|
|
168
170
|
next.value = ` ${next.value}`;
|
|
169
171
|
}
|
|
170
172
|
}
|