@adobe/helix-md2jcr 1.1.29 → 1.1.30

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
+ ## [1.1.30](https://github.com/adobe/helix-md2jcr/compare/v1.1.29...v1.1.30) (2025-08-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * ignore any inline images ([#135](https://github.com/adobe/helix-md2jcr/issues/135)) ([be36770](https://github.com/adobe/helix-md2jcr/commit/be3677000b55c3e19d0f05fff7223c9f227e6bfc)), closes [#134](https://github.com/adobe/helix-md2jcr/issues/134)
7
+
1
8
  ## [1.1.29](https://github.com/adobe/helix-md2jcr/compare/v1.1.28...v1.1.29) (2025-07-29)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-md2jcr",
3
- "version": "1.1.29",
3
+ "version": "1.1.30",
4
4
  "description": "Helix Service that converts markdown to JCR content structure",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "devDependencies": {
57
57
  "@adobe/eslint-config-helix": "3.0.8",
58
- "@adobe/helix-mediahandler": "2.7.21",
58
+ "@adobe/helix-mediahandler": "2.7.22",
59
59
  "@commitlint/cli": "^19.6.1",
60
60
  "@commitlint/config-conventional": "^19.6.0",
61
61
  "@semantic-release/changelog": "6.0.3",
@@ -70,7 +70,7 @@
70
70
  "eslint-plugin-import": "2.32.0",
71
71
  "husky": "^9.1.7",
72
72
  "junit-report-builder": "5.1.1",
73
- "lint-staged": "16.1.2",
73
+ "lint-staged": "16.1.5",
74
74
  "mocha": "11.7.1",
75
75
  "mocha-multi-reporters": "1.5.1",
76
76
  "nock": "13.5.6",
@@ -13,9 +13,16 @@ import Handlebars from 'handlebars';
13
13
  import { encodeHtml } from '../../utils.js';
14
14
 
15
15
  function image(context) {
16
- const uniqueName = Handlebars.helpers.nameHelper.call(context, 'image');
17
16
  const { alt, url } = context;
18
17
 
18
+ // discard any inline data images
19
+ if (url.startsWith('data:')) {
20
+ console.info(`[WARN] Discaring inline data image: ${url}`);
21
+ return '\n';
22
+ }
23
+
24
+ const uniqueName = Handlebars.helpers.nameHelper.call(context, 'image');
25
+
19
26
  const encoded = encodeHtml(url);
20
27
  return `<image${uniqueName} sling:resourceType="core/franklin/components/image/v1/image"
21
28
  jcr:primaryType="nt:unstructured" image="${encoded}" imageAlt="${encodeHtml(alt)}"/>\n`;
@@ -16,8 +16,10 @@ const image = {
16
16
 
17
17
  getProperties: (node) => {
18
18
  const imageNode = find(node, { type: 'image' });
19
+
20
+ // if the image url starts with data: then return an empty string for image url
19
21
  return {
20
- url: imageNode?.url || '',
22
+ url: imageNode?.url?.startsWith('data:') ? '' : imageNode?.url || '',
21
23
  alt: imageNode?.alt || '',
22
24
  label: imageNode?.label || '',
23
25
  };