html-to-gutenberg 4.2.7 → 4.2.8
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/index.js +3 -2
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -800,9 +800,10 @@ const block = async (
|
|
|
800
800
|
const getFixedHtml = (html) => {
|
|
801
801
|
function parseStyleString(style) {
|
|
802
802
|
const entries = style.split(';').filter(Boolean).map(rule => {
|
|
803
|
-
|
|
803
|
+
let [key, value] = rule.split(':');
|
|
804
804
|
if (!key || !value) return null;
|
|
805
|
-
|
|
805
|
+
key = key.trim().replace(/^[-\s]+/, '');
|
|
806
|
+
const camelKey = key.replace(/-([a-z])/g, (_, char) => char.toUpperCase());
|
|
806
807
|
return [camelKey, value.trim()];
|
|
807
808
|
}).filter(Boolean);
|
|
808
809
|
const styleObject = Object.fromEntries(entries);
|
package/package.json
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"type": "module",
|
|
24
24
|
"types": "index.ts",
|
|
25
25
|
"name": "html-to-gutenberg",
|
|
26
|
-
"version": "4.2.
|
|
26
|
+
"version": "4.2.8",
|
|
27
27
|
"description": "Transform any valid HTML string into fully editable WP Gutenberg blocks in seconds rather than hours.",
|
|
28
28
|
"main": "index.js",
|
|
29
29
|
"directories": {
|
|
@@ -56,4 +56,4 @@
|
|
|
56
56
|
"url": "https://github.com/DiogoAngelim/html-to-gutenberg/issues"
|
|
57
57
|
},
|
|
58
58
|
"homepage": "https://www.html-to-gutenberg.io"
|
|
59
|
-
}
|
|
59
|
+
}
|