@adobe/helix-html-pipeline 6.33.8 → 6.33.9
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.33.9](https://github.com/adobe/helix-html-pipeline/compare/v6.33.8...v6.33.9) (2026-11-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* strip icon notation from auto-generated description ([#1135](https://github.com/adobe/helix-html-pipeline/issues/1135)) ([32e9a35](https://github.com/adobe/helix-html-pipeline/commit/32e9a355b23f0648bf6c6ff67fe725910805962d)), closes [#1134](https://github.com/adobe/helix-html-pipeline/issues/1134)
|
|
7
|
+
|
|
1
8
|
## [6.33.8](https://github.com/adobe/helix-html-pipeline/compare/v6.33.7...v6.33.8) (2026-11-22)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
} from './utils.js';
|
|
19
19
|
import { toMetaName } from '../utils/modifiers.js';
|
|
20
20
|
import { childNodes } from '../utils/hast-utils.js';
|
|
21
|
+
import { REGEXP_ICON } from './rewrite-icons.js';
|
|
21
22
|
|
|
22
23
|
// common web image extensions
|
|
23
24
|
const IMAGE_EXTENSIONS = new Set(['avif', 'webp', 'png', 'jpg', 'jpeg', 'gif']);
|
|
@@ -178,7 +179,13 @@ function extractDescription(hast) {
|
|
|
178
179
|
let desc = '';
|
|
179
180
|
visit(hast, (node, idx, parent) => {
|
|
180
181
|
if (parent?.tagName === 'div' && node.tagName === 'p') {
|
|
181
|
-
|
|
182
|
+
// strip icon notation (e.g. ":icon-name:") so it doesn't leak into the description.
|
|
183
|
+
// this step runs before rewrite-icons, so icons are still authored as text here.
|
|
184
|
+
const words = toString(node)
|
|
185
|
+
.replace(REGEXP_ICON, '')
|
|
186
|
+
.trim()
|
|
187
|
+
.split(/\s+/)
|
|
188
|
+
.filter((w) => w);
|
|
182
189
|
if (words.length >= 10 || words.some((w) => w.length > 25 && !w.startsWith('http'))) {
|
|
183
190
|
desc = `${words.slice(0, 25).join(' ')}${words.length > 25 ? ' ...' : ''}`;
|
|
184
191
|
return EXIT;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { h } from 'hastscript';
|
|
14
14
|
import { CONTINUE, SKIP, visit } from 'unist-util-visit';
|
|
15
15
|
|
|
16
|
-
const REGEXP_ICON = /(?<!(?:https?|urn)[^\s]*):(#?[a-z_-]+[a-z\d]*):/gi;
|
|
16
|
+
export const REGEXP_ICON = /(?<!(?:https?|urn)[^\s]*):(#?[a-z_-]+[a-z\d]*):/gi;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a <span> icon element:
|