@adobe/helix-markdown-support 7.1.13 → 7.1.15

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.
@@ -11,10 +11,10 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - uses: actions/checkout@v5
14
- - name: Use Node.js 20.x
15
- uses: actions/setup-node@v5
14
+ - name: Use Node.js 24.x
15
+ uses: actions/setup-node@v6
16
16
  with:
17
- node-version: '22.x'
17
+ node-version: '24.x'
18
18
  - run: npm ci
19
19
  - run: npm run lint
20
20
  - run: npm test
@@ -32,12 +32,17 @@ jobs:
32
32
  runs-on: ubuntu-latest
33
33
  needs: test
34
34
  if: github.ref == 'refs/heads/main'
35
+ permissions:
36
+ contents: write
37
+ issues: write
38
+ pull-requests: write
39
+ id-token: write # needed for npm trusted publishers with OIDC
35
40
  steps:
36
41
  - uses: actions/checkout@v5
37
- - name: Use Node.js 20.x
38
- uses: actions/setup-node@v5
42
+ - name: Use Node.js 24.x
43
+ uses: actions/setup-node@v6
39
44
  with:
40
- node-version: '22.x'
45
+ node-version: '24.x'
41
46
  - run: npm ci
42
47
  - run: npm run semantic-release
43
48
  env:
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [7.1.15](https://github.com/adobe/helix-markdown-support/compare/v7.1.14...v7.1.15) (2025-11-20)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * trigger release ([944704a](https://github.com/adobe/helix-markdown-support/commit/944704adfb608d92352266e627f898fdd42e8766))
7
+
8
+ ## [7.1.14](https://github.com/adobe/helix-markdown-support/compare/v7.1.13...v7.1.14) (2025-10-15)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * 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))
14
+
1
15
  ## [7.1.13](https://github.com/adobe/helix-markdown-support/compare/v7.1.12...v7.1.13) (2025-10-06)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-markdown-support",
3
- "version": "7.1.13",
3
+ "version": "7.1.15",
4
4
  "description": "Helix Markdown Support",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "repository": {
14
14
  "type": "git",
15
- "url": "https://github.com/adobe/helix-markdown-support"
15
+ "url": "https://github.com/adobe/helix-markdown-support.git"
16
16
  },
17
17
  "author": "",
18
18
  "license": "Apache-2.0",
@@ -59,18 +59,18 @@
59
59
  "node": ">=14"
60
60
  },
61
61
  "devDependencies": {
62
- "@adobe/eslint-config-helix": "3.0.10",
63
- "@adobe/remark-gridtables": "3.0.14",
64
- "@eslint/config-helpers": "0.3.1",
62
+ "@adobe/eslint-config-helix": "3.0.14",
63
+ "@adobe/remark-gridtables": "3.0.15",
64
+ "@eslint/config-helpers": "0.4.2",
65
65
  "@semantic-release/changelog": "6.0.3",
66
66
  "@semantic-release/git": "10.0.1",
67
67
  "c8": "10.1.3",
68
68
  "eslint": "9.4.0",
69
69
  "husky": "9.1.7",
70
70
  "junit-report-builder": "5.1.1",
71
- "lint-staged": "16.1.6",
71
+ "lint-staged": "16.2.6",
72
72
  "mdast-builder": "1.1.1",
73
- "mocha": "11.7.2",
73
+ "mocha": "11.7.4",
74
74
  "mocha-multi-reporters": "1.5.1",
75
75
  "rehype-format": "5.0.1",
76
76
  "rehype-stringify": "10.0.1",
@@ -78,7 +78,7 @@
78
78
  "remark-parse": "11.0.0",
79
79
  "remark-rehype": "11.1.2",
80
80
  "remark-stringify": "11.0.0",
81
- "semantic-release": "24.2.8",
81
+ "semantic-release": "25.0.1",
82
82
  "unified": "11.0.5",
83
83
  "unist-util-inspect": "8.1.0"
84
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 { asciiPunctuation, markdownSpace, unicodePunctuation } from 'micromark-util-character';
13
+ import { markdownSpace, unicodePunctuation } from 'micromark-util-character';
14
14
 
15
15
  export function isFormat(type) {
16
16
  return type === 'strong'
@@ -27,8 +27,8 @@ function isSnug(type) {
27
27
 
28
28
  const FLOW_SORT_ORDER = [
29
29
  'delete',
30
- 'strong',
31
30
  'emphasis',
31
+ 'strong',
32
32
  'link',
33
33
  'underline',
34
34
  'subscript',
@@ -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 before format has trailing whitespace
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 (children.length && next?.type === 'text' && !isSnug(node.type)) {
166
- const code = next.value.charCodeAt(0);
167
- if (!asciiPunctuation(code) && !markdownSpace(code) && !unicodePunctuation(code)) {
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
  }