@adobe/helix-html-pipeline 5.0.2 → 5.0.4
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 +14 -0
- package/package.json +18 -18
- package/src/steps/create-page-blocks.js +3 -0
- package/src/steps/extract-metadata.js +4 -4
- package/src/utils/section-handler.js +13 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [5.0.4](https://github.com/adobe/helix-html-pipeline/compare/v5.0.3...v5.0.4) (2023-09-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* update unified dependencies ([2f8a2ec](https://github.com/adobe/helix-html-pipeline/commit/2f8a2ec3020b2daef0d4fe1935ba20ef4c1c08f1))
|
|
7
|
+
|
|
8
|
+
## [5.0.3](https://github.com/adobe/helix-html-pipeline/compare/v5.0.2...v5.0.3) (2023-09-21)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* properly rewrite meta image ([#406](https://github.com/adobe/helix-html-pipeline/issues/406)) ([d0c173f](https://github.com/adobe/helix-html-pipeline/commit/d0c173f21942f6fb123ff6d4288364d4b9f0ec98)), closes [#405](https://github.com/adobe/helix-html-pipeline/issues/405)
|
|
14
|
+
|
|
1
15
|
## [5.0.2](https://github.com/adobe/helix-html-pipeline/compare/v5.0.1...v5.0.2) (2023-09-14)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-html-pipeline",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"description": "Helix HTML Pipeline",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -42,26 +42,26 @@
|
|
|
42
42
|
"node": ">=16.x"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@adobe/helix-markdown-support": "
|
|
45
|
+
"@adobe/helix-markdown-support": "7.0.0",
|
|
46
46
|
"@adobe/helix-shared-utils": "3.0.0",
|
|
47
|
-
"@adobe/mdast-util-gridtables": "
|
|
48
|
-
"@adobe/remark-gridtables": "
|
|
47
|
+
"@adobe/mdast-util-gridtables": "3.0.0",
|
|
48
|
+
"@adobe/remark-gridtables": "2.0.1",
|
|
49
49
|
"cookie": "0.5.0",
|
|
50
50
|
"github-slugger": "2.0.0",
|
|
51
|
-
"hast-util-raw": "
|
|
52
|
-
"hast-util-select": "
|
|
53
|
-
"hast-util-to-html": "
|
|
54
|
-
"hast-util-to-string": "
|
|
55
|
-
"hastscript": "
|
|
51
|
+
"hast-util-raw": "9.0.1",
|
|
52
|
+
"hast-util-select": "6.0.1",
|
|
53
|
+
"hast-util-to-html": "9.0.0",
|
|
54
|
+
"hast-util-to-string": "3.0.0",
|
|
55
|
+
"hastscript": "8.0.0",
|
|
56
56
|
"jose": "4.14.6",
|
|
57
|
-
"mdast-util-to-hast": "
|
|
57
|
+
"mdast-util-to-hast": "13.0.2",
|
|
58
58
|
"mdast-util-to-string": "4.0.0",
|
|
59
59
|
"mime": "3.0.0",
|
|
60
|
-
"rehype-format": "
|
|
61
|
-
"rehype-parse": "
|
|
62
|
-
"remark-parse": "
|
|
60
|
+
"rehype-format": "5.0.0",
|
|
61
|
+
"rehype-parse": "9.0.0",
|
|
62
|
+
"remark-parse": "11.0.0",
|
|
63
63
|
"strip-markdown": "5.0.1",
|
|
64
|
-
"unified": "
|
|
64
|
+
"unified": "11.0.3",
|
|
65
65
|
"unist-util-map": "4.0.0",
|
|
66
66
|
"unist-util-remove": "4.0.0",
|
|
67
67
|
"unist-util-remove-position": "5.0.0",
|
|
@@ -74,13 +74,13 @@
|
|
|
74
74
|
"@markedjs/html-differ": "4.0.2",
|
|
75
75
|
"@semantic-release/changelog": "6.0.3",
|
|
76
76
|
"@semantic-release/git": "10.0.1",
|
|
77
|
-
"@semantic-release/npm": "
|
|
77
|
+
"@semantic-release/npm": "11.0.0",
|
|
78
78
|
"c8": "8.0.1",
|
|
79
|
-
"eslint": "8.
|
|
79
|
+
"eslint": "8.50.0",
|
|
80
80
|
"eslint-import-resolver-exports": "1.0.0-beta.5",
|
|
81
81
|
"eslint-plugin-header": "3.1.1",
|
|
82
82
|
"eslint-plugin-import": "2.28.1",
|
|
83
|
-
"esmock": "2.
|
|
83
|
+
"esmock": "2.5.1",
|
|
84
84
|
"husky": "8.0.3",
|
|
85
85
|
"js-yaml": "4.1.0",
|
|
86
86
|
"jsdom": "22.1.0",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"mocha": "10.2.0",
|
|
90
90
|
"mocha-multi-reporters": "1.5.1",
|
|
91
91
|
"mocha-suppress-logs": "0.3.1",
|
|
92
|
-
"semantic-release": "
|
|
92
|
+
"semantic-release": "22.0.5"
|
|
93
93
|
},
|
|
94
94
|
"lint-staged": {
|
|
95
95
|
"*.js": "eslint",
|
|
@@ -45,6 +45,9 @@ function tableToDivs($table) {
|
|
|
45
45
|
|
|
46
46
|
// get columns names
|
|
47
47
|
$cards.properties.className = toBlockCSSClassNames(toString($headerCols[0]));
|
|
48
|
+
if ($cards.properties.className.length === 0) {
|
|
49
|
+
delete $cards.properties.className;
|
|
50
|
+
}
|
|
48
51
|
|
|
49
52
|
// construct page block
|
|
50
53
|
for (const $row of $rows) {
|
|
@@ -248,10 +248,10 @@ export default function extractMetaData(state, req) {
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
if (!('image' in meta)) {
|
|
251
|
-
meta.image =
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
);
|
|
251
|
+
meta.image = content.image || '/default-meta-image.png';
|
|
252
|
+
}
|
|
253
|
+
if (meta.image) {
|
|
254
|
+
meta.image = getAbsoluteUrl(state, optimizeMetaImage(state.info.path, meta.image));
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
meta.imageAlt = meta['image-alt'] ?? content.imageAlt;
|
|
@@ -9,8 +9,6 @@
|
|
|
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 { all } from 'mdast-util-to-hast';
|
|
13
|
-
|
|
14
12
|
const HELIX_NAMESPACE = 'hlx-';
|
|
15
13
|
const DEFAULT_SECTION_TAG = 'div';
|
|
16
14
|
const DEFAULT_SECTION_CLASS = `${HELIX_NAMESPACE}section`;
|
|
@@ -55,17 +53,22 @@ function getAttributes(section) {
|
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
export default function sectionHandler() {
|
|
58
|
-
return function handler(
|
|
56
|
+
return function handler(state, node) {
|
|
59
57
|
const n = { ...node };
|
|
60
58
|
|
|
61
59
|
const tagName = getTagName(n);
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
if (
|
|
65
|
-
|
|
60
|
+
const properties = getAttributes(n);
|
|
61
|
+
properties.className = [DEFAULT_SECTION_CLASS];
|
|
62
|
+
if (properties.class) {
|
|
63
|
+
properties.className.push(...properties.class.split(/\s+/));
|
|
66
64
|
}
|
|
67
|
-
delete
|
|
68
|
-
const children = all(
|
|
69
|
-
return
|
|
65
|
+
delete properties.class;
|
|
66
|
+
const children = state.all(n);
|
|
67
|
+
return {
|
|
68
|
+
type: 'element',
|
|
69
|
+
tagName,
|
|
70
|
+
properties,
|
|
71
|
+
children,
|
|
72
|
+
};
|
|
70
73
|
};
|
|
71
74
|
}
|