Skip to content

Commit ff73a8f

Browse files
committed
MC-2347: HTML lines group in one row after save CMS Page
Use bypass-html-filter class to prevent removal of whitespace
1 parent c81819d commit ff73a8f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/master-format/filter-html.js

Lines changed: 2 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/template/content-type/html/default/master.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
*/
66
-->
77

8-
<div attr="data.main.attributes" css="data.main.css" ko-style="data.main.style" html="data.main.html"></div>
8+
<div attr="data.main.attributes" css="data.main.css" ko-style="data.main.style" html="data.main.html" class="bypass-html-filter"></div>

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/master-format/filter-html.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export default function filterHtml(element: JQuery): JQuery {
2222
element.find("*").each(
2323
(index, value) => {
2424
const isIframe = value.tagName === "IFRAME";
25-
const isPartOfHtmlContentType = !!$(value).closest('[data-role="html"]').length;
26-
if (!isIframe && !isPartOfHtmlContentType) {
25+
const isBeingBypassedByThisFilter = !!$(value).closest('.bypass-html-filter').length;
26+
if (!isIframe && !isBeingBypassedByThisFilter) {
2727
$(value).contents().filter(isWhiteSpaceOrComment).remove();
2828
}
2929
},

0 commit comments

Comments
 (0)