@naersen/tts-rich-text 0.8.2 → 0.8.3
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 +6 -0
- package/dist/index.js +16 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1622,7 +1622,22 @@ const Uh = {
|
|
|
1622
1622
|
return {
|
|
1623
1623
|
id: { default: "" },
|
|
1624
1624
|
categ: { default: o },
|
|
1625
|
-
payload: {
|
|
1625
|
+
payload: {
|
|
1626
|
+
default: {},
|
|
1627
|
+
renderHTML: ({ payload: s }) => ({
|
|
1628
|
+
payload: JSON.stringify(s ?? {}) ?? "{}"
|
|
1629
|
+
}),
|
|
1630
|
+
parseHTML: (s) => {
|
|
1631
|
+
const h = s.getAttribute("payload");
|
|
1632
|
+
if (!h) return {};
|
|
1633
|
+
try {
|
|
1634
|
+
const r = JSON.parse(h);
|
|
1635
|
+
return r && typeof r == "object" ? r : {};
|
|
1636
|
+
} catch {
|
|
1637
|
+
return {};
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1626
1641
|
};
|
|
1627
1642
|
},
|
|
1628
1643
|
parseHTML() {
|