@platecms/delta-cast-util-to-html 1.18.0 → 1.20.0

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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/index.spec.ts +19 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platecms/delta-cast-util-to-html",
3
- "version": "1.18.0",
3
+ "version": "1.20.0",
4
4
  "description": "Utility to convert CAST directly to HTML using HAST and HAST sanitizing.",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
@@ -17,9 +17,9 @@
17
17
  "src/**/*"
18
18
  ],
19
19
  "dependencies": {
20
- "@platecms/delta-cast": "1.18.0",
21
- "@platecms/delta-cast-util-to-hast": "1.18.0",
22
- "@platecms/delta-plate-resource-notation": "1.18.0",
20
+ "@platecms/delta-cast": "1.20.0",
21
+ "@platecms/delta-cast-util-to-hast": "1.20.0",
22
+ "@platecms/delta-plate-resource-notation": "1.20.0",
23
23
  "class-transformer": "0.5.1",
24
24
  "hast": "1.0.0",
25
25
  "hast-util-sanitize": "5.0.2",
package/src/index.spec.ts CHANGED
@@ -12,4 +12,23 @@ describe("cast-util-to-html", () => {
12
12
  // Assert
13
13
  expect(html).toBe("<p>Hello, world!</p>");
14
14
  });
15
+
16
+ it("should not publish the PRN of an interpolated content value", () => {
17
+ // Arrange
18
+ const cast = c("root", [
19
+ c("paragraph", [
20
+ c("text", "Price: "),
21
+ c("contentValue", {
22
+ prn: "prn:plate:-1:cms:content-value:1",
23
+ value: c("root", [c("paragraph", "€ 10")]),
24
+ }),
25
+ ]),
26
+ ]);
27
+
28
+ // Act
29
+ const html = toHtml(cast);
30
+
31
+ // Assert
32
+ expect(html).toBe("<p>Price: <span>€ 10</span></p>");
33
+ });
15
34
  });