-
-
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
Pasted plain text with line breaks, can't add a list to each line #1727
Comments
CKEditor 4 also allows turning lines between soft breaks into list items. However, it comes at a cost. This content: <p>foo<br>bar<br>bom</p> Will become this after applying the list to a selection placed in "bar": <p>foo</p>
<ul><li>bar</li></ul>
<p>bom</p> And after you remove the list, you'll get: <p>foo</p>
<p>bar</p>
<p>bom</p> So a different content than the one you started with. But, OTOH, it's the same if the middle line was a heading, so perhaps it's fine. |
So how should I use |
I'm sorry but I don't understand your question. I checked that Google Docs behaves like CKEditor 5 β the entire block is converted into list item. And, MS Word behaves like CKEditor 5 as well. Which means that only CKEditor 4 behaves differently here. cc @mlewand |
Maybe when pasting from Notepad, |
That's because in this case, Google Docs creates two separate paragraphs after paste. If you try to create a paragraph with a soft brake and apply a list, you'll notice it behaves like CKEditor 5.
You're right, CKEditor 5 doesn't create a new paragraph for each line pasted from Notepad. |
So, it's a question whether single line breaks in plain text should create new paragraphs or We should open a new ticket with a better description and close this one. How line breaks are pasted will affect more features (e.g. headings, text alignment, image insertion). I'd be fine with changing the current algorithm and I think it wasn't criticised for the first time |
I think the paste behavior should be the same as the main editor, whether a single line break in plain text should create a new paragraph when pasted, or configurable. |
What do you mean by "main editor"? |
mainstream editor, popular editor, for example: MS Word, Google Doc. @Reinmar |
Other: New lines pasted as a plain text will always create a new paragraph. Closes ckeditor/ckeditor5#1727. BREAKING CHANGE: From now on, every new line pasted in the editor as a plain text, will create a new paragraph. Read more at ckeditor/ckeditor5#1727.
Is this a bug report or feature request? (choose one)
Other
π» Version of CKEditor
12.0.7
π Steps to reproduce
β Expected result
Add a list to each line
β Actual result
Only added to the first line
π Other details that might be useful
Inconsistent with Microsoft Word
The text was updated successfully, but these errors were encountered: