@tryghost/mg-clean-html 0.2.13 → 0.2.15
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/lib/process.js +4 -1
- package/package.json +5 -5
package/lib/process.js
CHANGED
|
@@ -33,7 +33,7 @@ const cleanHTML = (args) => {
|
|
|
33
33
|
|
|
34
34
|
const $html = $.load(html, {
|
|
35
35
|
decodeEntities: false
|
|
36
|
-
});
|
|
36
|
+
}, false); // This `false` is `isDocument`. If `true`, <html>, <head>, and <body> elements are introduced
|
|
37
37
|
|
|
38
38
|
// Remove left, center & right text alignment
|
|
39
39
|
if (opinionated) {
|
|
@@ -288,6 +288,9 @@ const cleanHTML = (args) => {
|
|
|
288
288
|
// convert HTML back to a string
|
|
289
289
|
html = $html.html();
|
|
290
290
|
|
|
291
|
+
// Remove empty attributes
|
|
292
|
+
html = html.replace(/=""/g, '');
|
|
293
|
+
|
|
291
294
|
return html;
|
|
292
295
|
};
|
|
293
296
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/mg-clean-html",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"repository": "https://github.com/TryGhost/migrate/tree/main/packages/mg-clean-html",
|
|
5
5
|
"author": "Ghost Foundation",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"eslint": "8.
|
|
23
|
+
"eslint": "8.55.0",
|
|
24
24
|
"jest": "29.7.0",
|
|
25
25
|
"jest-extended": "4.0.2"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"cheerio": "0.
|
|
28
|
+
"cheerio": "1.0.0-rc.12",
|
|
29
29
|
"escape-string-regexp": "5.0.0",
|
|
30
|
-
"style-to-object": "0.
|
|
30
|
+
"style-to-object": "1.0.5"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "e91603ed4e431bba60521d63a070e397d2ccee2f"
|
|
33
33
|
}
|