Skip to content

Commit

Permalink
fix: treat RTE wrappers as default content
Browse files Browse the repository at this point in the history
  • Loading branch information
buuhuu committed Jul 24, 2024
1 parent 89f71c9 commit fab30b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/aem.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,10 @@ function decorateSections(main) {
const wrappers = [];
let defaultContent = false;
[...section.children].forEach((e) => {
if (e.tagName === 'DIV' || !defaultContent) {
if ((e.tagName === 'DIV' && e.className) || !defaultContent) {
const wrapper = document.createElement('div');
wrappers.push(wrapper);
defaultContent = e.tagName !== 'DIV';
defaultContent = e.tagName !== 'DIV' || !e.className;
if (defaultContent) wrapper.classList.add('default-content-wrapper');
}
wrappers[wrappers.length - 1].append(e);
Expand Down

0 comments on commit fab30b4

Please sign in to comment.