@adobe/helix-md2jcr 1.1.2 → 1.1.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 CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.1.4](https://github.com/adobe/helix-md2jcr/compare/v1.1.3...v1.1.4) (2025-03-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **section:** extract section metadata ([#65](https://github.com/adobe/helix-md2jcr/issues/65)) ([6cad72e](https://github.com/adobe/helix-md2jcr/commit/6cad72ef8880c2c047236cb740956f334903e86c))
7
+
8
+ ## [1.1.3](https://github.com/adobe/helix-md2jcr/compare/v1.1.2...v1.1.3) (2025-03-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update dependency @adobe/fetch to v4.2.0 ([#64](https://github.com/adobe/helix-md2jcr/issues/64)) ([a509b0c](https://github.com/adobe/helix-md2jcr/commit/a509b0c5d3f7a86d7af941799d30f62b27e63e20))
14
+
1
15
  ## [1.1.2](https://github.com/adobe/helix-md2jcr/compare/v1.1.1...v1.1.2) (2025-02-26)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-md2jcr",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Helix Service that converts markdown to JCR content structure",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "homepage": "https://github.com/adobe/helix-md2jcr#readme",
30
30
  "dependencies": {
31
- "@adobe/fetch": "4.1.11",
31
+ "@adobe/fetch": "4.2.0",
32
32
  "@adobe/helix-markdown-support": "7.1.12",
33
33
  "@adobe/helix-shared-process-queue": "3.1.1",
34
34
  "@adobe/remark-gridtables": "3.0.10",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "devDependencies": {
57
57
  "@adobe/eslint-config-helix": "2.0.9",
58
- "@adobe/helix-mediahandler": "2.6.3",
58
+ "@adobe/helix-mediahandler": "2.6.4",
59
59
  "@commitlint/cli": "^19.6.1",
60
60
  "@commitlint/config-conventional": "^19.6.0",
61
61
  "@semantic-release/changelog": "6.0.3",
@@ -13,7 +13,7 @@ import Handlebars from 'handlebars';
13
13
  import { find } from 'unist-util-find';
14
14
  import { toString } from 'mdast-util-to-string';
15
15
  import { findAll } from '../../utils/mdast.js';
16
- import { findModelById, getModelFields } from '../../domain/Models.js';
16
+ import { findModelById, getField, getModelFields } from '../../domain/Models.js';
17
17
 
18
18
  function sectionHelper(index, children, options) {
19
19
  const {
@@ -25,7 +25,7 @@ function sectionHelper(index, children, options) {
25
25
  'jcr:primaryType': 'nt:unstructured',
26
26
  };
27
27
 
28
- const model = findModelById(models, 'section-metadata');
28
+ const model = findModelById(models, 'section');
29
29
  if (model) {
30
30
  const fields = getModelFields(model);
31
31
  attributes.modelFields = `[${fields}]`;
@@ -45,10 +45,12 @@ function sectionHelper(index, children, options) {
45
45
  const cells = findAll(row, (n) => n.type === 'gtCell', true);
46
46
  const key = toString(cells[0]);
47
47
  const value = toString(cells[1]);
48
- if (key === 'Style') {
49
- attributes.classes = value;
48
+ const field = getField(model, key);
49
+ if (field?.component === 'multiselect') {
50
+ const multiValue = value.split(',').map((s) => s.trim()).filter(Boolean);
51
+ attributes[key.toLowerCase().replaceAll(' ', '-')] = `[${multiValue.join(',')}]`;
50
52
  } else {
51
- attributes[`data-${key.toLowerCase().replaceAll(' ', '-')}`] = value;
53
+ attributes[key.toLowerCase().replaceAll(' ', '-')] = value;
52
54
  }
53
55
  }
54
56
  break;