-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Render <style>
elements from <head>
section of editor data content when using fullPage
plugin.
#17880
Render <style>
elements from <head>
section of editor data content when using fullPage
plugin.
#17880
Conversation
…behind an option.
fullPage
plugin.<style>
elements from <head>
section of editor data content when using fullPage
plugin.
Looks fine imo, I'll test it tomorrow. |
* it is strongly recommended to define a sanitize function that will clean up the CSS | ||
* which is present in the `<head>` in editors content in order to avoid XSS vulnerability. | ||
* | ||
* For a detailed overview, check the {@glink TODO} documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When docs will be updated, proper link will be added.
@pszczesniak I'm not sure if simple copying of the styles is good enough. Consider that situation. That's the content of HTML passed to the full style HTML plugin: <head>
<style>
p { color: red; }
</style>
<body>
<p>Hello</p>
</body>
</head> Does it mean that the plugin will copy |
@Mati365 Yes, now it will work exactly like you wrote. Was thinking about scoping it with
|
This is a |
Works fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected 👍
packages/ckeditor5-html-support/tests/manual/fullpage-with-head-styles.md
Outdated
Show resolved
Hide resolved
packages/ckeditor5-html-support/tests/manual/fullpage-with-head-styles.js
Outdated
Show resolved
Hide resolved
const domParser = editor.data.htmlProcessor.domParser; | ||
const doc = domParser.parseFromString( fullPageData, 'text/html' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could avoid double parsing by extending HtmlPageDataProcessor
so it could expose a dedicated property for styles?
…nt-from-head-using-fullpage-plugin.
Suggested merge commit message (convention)
Feature(html-support): Introducing the ability to render
<style>
elements from the<head>
section of editor data content usingFullPage
plugin. See #13482.Additional information
For example – encountered issues, assumptions you had to make, other affected tickets, etc.