Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(addon-editor): normalize h1-h6 heading in editor socket #2808

Merged
merged 1 commit into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
&._preview-image img {
cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6 {
word-break: break-word;
line-height: normal;
}
}

/* stylelint-disable-next-line */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,22 @@ describe(`Editor API`, () => {
});
}
});

describe(`Heading styles`, () => {
for (const heading of [`h1`, `h2`, `h3`, `h4`, `h5`, `h6`]) {
it(heading, () => {
tuiVisitEditorApiPage({
content: `<${heading}><span%20style%3D"background-color:%20%231771e6; color: %20%23fff">ываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываывамсываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываывамс</span></${heading}><${heading}>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</${heading}>`,
skipDecodingUrl: true,
});

cy.get(`[contenteditable]`).focus();

tuiGetDemoContent()
.find(`tui-editor-socket.tui-example`)
.wait(WAIT_BEFORE_SCREENSHOT)
.matchImageSnapshot();
});
}
});
});