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

Autoparagraphing ignores empty elements #3296

Closed
Reinmar opened this issue Dec 19, 2016 · 2 comments · Fixed by ckeditor/ckeditor5-paragraph#23
Closed

Autoparagraphing ignores empty elements #3296

Reinmar opened this issue Dec 19, 2016 · 2 comments · Fixed by ckeditor/ckeditor5-paragraph#23
Assignees
Labels
package:paragraph type:improvement This issue reports a possible enhancement of an existing feature.
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Dec 19, 2016

Currently, loading a single image or foo<img>bar into the editor will not trigger the autoparagraphing of that image (if images were treated as inline elements).

This is a conscious decision made in order to simplify #3291, because I had enough fun implementing the behaviour for the text. Also, https://github.com/ckeditor/ckeditor5-paragraph/issues/10 is more actually more important than this issue, so I'd actually spend time fixing that one.

What makes this particular issue even less important is that right now we have only one such element – image, and it's block oriented. Plus, it will have to have its own converter for inline images: https://github.com/ckeditor/ckeditor5-image/issues/8.

@scofalik
Copy link
Contributor

scofalik commented Apr 24, 2017

I tried to fix it in naive way, by allowing autoparagraphText converter to be fired also for elements, but this fails because first default to-document-fragment converter is fired.

We should think whether it makes more sense to have autoparagraphText fired before default to-document-fragment converter. For me it makes sense because in autoparagraphText we are trying to fire non-default conversion.

@scofalik
Copy link
Contributor

I tried to fix it in naive way, by allowing autoparagraphText converter to be fired also for elements

Okay, this idea is bad because we should also check whether given element is allowed in paragraph (current autoparagraphText silently assumes that bare text is always allowed in paragraph). To check this, we need to know to which element current element will be converted because we need that info for schema.check(). ATM we are unable to get it because we don't know to what element data.input is supposed to be converted.

Reinmar referenced this issue in ckeditor/ckeditor5-paragraph May 3, 2017
Fix: Content autoparagraphing has been improved. "Inline" view elements (converted to attributes or elements) will be now correctly handled and autoparagraphed. Closes #10. Closes #11.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-paragraph Oct 9, 2019
@mlewand mlewand added this to the iteration 10 milestone Oct 9, 2019
@mlewand mlewand added status:confirmed type:improvement This issue reports a possible enhancement of an existing feature. package:paragraph labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:paragraph type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants