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

Pasting a certain HTML crashes the editor #1572

Closed
Reinmar opened this issue Feb 22, 2019 · 1 comment
Closed

Pasting a certain HTML crashes the editor #1572

Reinmar opened this issue Feb 22, 2019 · 1 comment
Labels
type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Feb 22, 2019

Paste the following HTML to the editor:

<meta charset='utf-8'><h4 style="box-sizing: border-box; margin: 0px 0px 0.2em; padding: 0.8em 0px 0px; border: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-weight: 400; font-stretch: inherit; font-size: 1.2em; line-height: 1.4em; font-family: &quot;Source Sans Pro&quot;, &quot;SF Pro Text&quot;, &quot;SF Pro Icons&quot;, Roboto, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; vertical-align: baseline; position: relative; color: rgb(26, 26, 26); letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;">Static methods</h4><ul class="collapsing-list collapsing-list--filtered" data-type="methods" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-weight: 400; font-stretch: inherit; font-size: 15px; line-height: 1.6em; font-family: &quot;Source Sans Pro&quot;, &quot;SF Pro Text&quot;, &quot;SF Pro Icons&quot;, Roboto, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; vertical-align: baseline; list-style: none; max-width: initial; min-width: initial; color: rgb(26, 26, 26); letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;"><li class="collapsing-list__item collapsing-list__item--visible collapsing-list__item--first" data-public="true" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; display: block;"><div class="collapsing-list__term toggler--collapsed" id="static-function-create" style="box-sizing: border-box; margin: 0px; padding: 0.25em 0px 0.25em 1.5em; border: 0px; font: inherit; vertical-align: baseline; position: relative; display: flex; cursor: pointer;"><h3 style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: 400; font-stretch: inherit; font-size: 1em; line-height: 1.6em; font-family: inherit; vertical-align: baseline; position: relative; flex: 2 1 0%;"><code style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: 400; font-stretch: inherit; font-size: 0.866666em; line-height: inherit; font-family: &quot;SF Mono&quot;, menlo, monaco, &quot;Roboto Mono&quot;, Consolas, &quot;Lucida Console&quot;, monospace; vertical-align: baseline; background: none; border-radius: 3px;"><a class="member-name" href="https://ckeditor.com/docs/ckeditor5/latest/api/module_editor-classic_classiceditor-ClassicEditor.html#static-function-create" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: bold; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; color: rgb(27, 58, 242); text-decoration: none;">create</a>( sourceElementOrData, config ) → <span style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline;">Promise</span></code></h3></div></li></ul>

An error is thrown:

ckeditorerror.js:46 Uncaught CKEditorError: model-position-after-root: You cannot make a position after root. Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-model-position-after-root
 {"root":{"name":"$clipboardHolder","children":[{"name":"heading3","children":[{"data":"Static methods"}]},{"attributes":{"listIndent":0,"listType":"bulleted"},"name":"listItem"},{"name":"paragraph"},{"name":"heading2","children":[{"attributes":{"bold":true,"linkHref":"https://ckeditor.com/docs/ckeditor5/latest/api/module_editor-classic_classiceditor-ClassicEditor.html#static-function-create"},"data":"create"},{"data":"( sourceElementOrData, config ) → Promise"}]},{"name":"paragraph"},{"attributes":{"listIndent":0,"listType":"bulleted"},"name":"listItem"}]}}
    at Function._createAfter (http://localhost:8125/ckeditor5-core/tests/manual/article.js:57581:10)
    at Model.createPositionAfter (http://localhost:8125/ckeditor5-core/tests/manual/article.js:50950:60)
    at Writer.createPositionAfter (http://localhost:8125/ckeditor5-core/tests/manual/article.js:64035:21)
    at viewToModelListItemChildrenConverter (http://localhost:8125/ckeditor5-core/tests/manual/article.js:85088:26)
    at UpcastDispatcher.viewModelConverter (http://localhost:8125/ckeditor5-core/tests/manual/article.js:84628:24)
    at UpcastDispatcher.fire (http://localhost:8125/ckeditor5-core/tests/manual/article.js:107972:29)
    at UpcastDispatcher._convertItem (http://localhost:8125/ckeditor5-core/tests/manual/article.js:43814:9)
    at UpcastDispatcher._convertChildren (http://localhost:8125/ckeditor5-core/tests/manual/article.js:43845:24)
    at UpcastDispatcher.<anonymous> (http://localhost:8125/ckeditor5-core/tests/manual/article.js:44481:54)
    at UpcastDispatcher.fire (http://localhost:8125/ckeditor5-core/tests/manual/article.js:107972:29)
@Reinmar Reinmar added type:bug This issue reports a buggy (incorrect) behavior. status:confirmed labels Feb 22, 2019
@Reinmar Reinmar added this to the iteration 22 milestone Feb 22, 2019
@Reinmar
Copy link
Member Author

Reinmar commented Feb 22, 2019

It's a regression.

Reinmar added a commit to ckeditor/ckeditor5-list that referenced this issue Feb 25, 2019
Fix: Editor was crashing if multiple, specific block elements were inside list item in loaded/pasted data. Closes [ckeditor/ckeditor5#1572](ckeditor/ckeditor5#1572).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

1 participant