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

The document with just <script> or <style> element becomes empty #11247

Closed
maxbarnas opened this issue Feb 9, 2022 · 1 comment · Fixed by #11368
Closed

The document with just <script> or <style> element becomes empty #11247

maxbarnas opened this issue Feb 9, 2022 · 1 comment · Fixed by #11368
Assignees
Labels
package:engine package:html-support release:blocker This issue blocks the upcoming release (is critical). squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@maxbarnas
Copy link
Contributor

maxbarnas commented Feb 9, 2022

📝 Provide detailed reproduction steps (if any)

In ckeditor5-html-support/tests/manual/ghs-all-features.html:

  1. Set in Source Editing mode (whitespace before or after does not matter):
<script>foo</script>

or

<style>foo</style>
  1. Switch to regular mode and then back to source editing mode (or call editor.getData()).

✔️ Expected result

Same data as set.

❌ Actual result

Empty string.

@maxbarnas maxbarnas added type:bug This issue reports a buggy (incorrect) behavior. package:engine squad:core Issue to be handled by the Core team. labels Feb 9, 2022
@Reinmar Reinmar changed the title The <script or <style> elements at the very beginning of the document should not be removed The <script> or <style> elements at the very beginning of the document should not be removed Feb 9, 2022
@maxbarnas maxbarnas changed the title The <script> or <style> elements at the very beginning of the document should not be removed The document with just <script> or <style> element becomes empty Feb 9, 2022
@niegowski
Copy link
Contributor

Seems like those model elements should be marked as isContent in the model schema (those do not contain any text, their content is stored inside a model element attribute).

@CKEditorBot CKEditorBot added the status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. label Feb 28, 2022
@dawidurbanski dawidurbanski self-assigned this Mar 1, 2022
@CKEditorBot CKEditorBot added status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. and removed status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. labels Mar 1, 2022
@Reinmar Reinmar added the release:blocker This issue blocks the upcoming release (is critical). label Mar 1, 2022
oleq added a commit that referenced this issue Mar 1, 2022
…ty-content

Fix (html-support): Prevent `<script>` and `<style>` tags removal when the only content in the editor. Closes #11247.
@CKEditorBot CKEditorBot added this to the iteration 51 milestone Mar 1, 2022
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine package:html-support release:blocker This issue blocks the upcoming release (is critical). squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants