-
-
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
Handle <style>
tag
#11235
Handle <style>
tag
#11235
Conversation
3cc51eb
to
e71d3b5
Compare
e71d3b5
to
db8b2d9
Compare
db8b2d9
to
003e537
Compare
*/ | ||
|
||
/** | ||
* The {@link module:engine/view/domconverter~DomConverter} detected a `<style>` element that may affect the editing experience. |
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.
"While rendering the editor content, the ..."
"To avoid this, the <style>
element was replaced with ..."
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.
Fixed.
|
||
describe( 'StyleElementSupport', () => { | ||
const STYLE = 'div { color: red; }'; | ||
const CODE_CPP = 'cout << "Hello World" << endl;'; |
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.
Isn't it a leftover from the <script>
's tests?
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.
Fixed.
420b4e7
to
8e3fede
Compare
I improved the manual tests a bit because there was no place where I could easily test the change. Issue 1.I stumbled upon an odd issue (probably not a blocker for this PR). The below content works fine: <p>
x
</p>
<script>a</script><style>a</style>
<p>
x
</p> However, this gets miss-formatted after being passed via setData->getData: <p>
x
</p>
<script>a</script>
<style>a</style>
<p>
x
</p> Upon <p>x</p><script>a</script><p> <style>a</style></p><p>x</p> For some reason, the new line character is not correctly ignored by Issue 2.This issue is not a blocker as well, but should be resolved soon. Try this:
An empty string is returned. Same for a lone |
Second issue is definitely a separate topic that exists for a long time. The first one though... that's new. Should I create a ticket for that? |
Both deserve tickets. Could you search whether they exist already and if not open new ones? I'd also like to prioritize the second one because it may lead to data loss. |
Both had the same issue – they missed the context of what's happening. Something was detected... but when? Integrators have no idea what DomConverter is. They might even start worrying that their script tags were completely lost. My changes make the former clearer and slightly (although, not completely) help with the latter. So the error could be made even better, explaining that this is happening only inside the editor. |
Suggested merge commit message (convention)
Other (engine): The
<style>
tag will not interfere with the editing experience. Closes #11104.Feature (html-support): Added
<style>
tag support. Closes #11104.Additional information
For example – encountered issues, assumptions you had to make, other affected tickets, etc.