Skip to content

Commit 367258b

Browse files
committed
PB-284: Improve live edit
1 parent f5a76c0 commit 367258b

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/binding/live-edit.js

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/binding/live-edit.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ import {DataObject} from "../data-store";
1818
* @returns {string}
1919
*/
2020
function stripHtml(html: string) {
21-
const htmlDocument = new DOMParser().parseFromString(html, "text/html");
21+
if (html) {
22+
const htmlDocument = new DOMParser().parseFromString(html, "text/html");
2223

23-
return htmlDocument.body.textContent;
24+
return htmlDocument.body ? htmlDocument.body.textContent : "";
25+
}
26+
27+
return html;
2428
}
2529

2630
/**

0 commit comments

Comments
 (0)