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

Add tests for an inline editor on a <p> or <h1> #2253

Closed
Reinmar opened this issue Mar 9, 2017 · 7 comments
Closed

Add tests for an inline editor on a <p> or <h1> #2253

Reinmar opened this issue Mar 9, 2017 · 7 comments
Assignees
Labels
package:editor-inline type:task This issue reports a chore (non-production change) and other types of "todos".

Comments

@Reinmar
Copy link
Member

Reinmar commented Mar 9, 2017

AFAICS https://github.com/ckeditor/ckeditor5-editor-inline/issues/3 discusses how the editor should work on various elements.

Here, I'd just to have a sample for what happens now when you enable an editor on e.g. <p>. I can already tell that there may be problems with what kind of root is created in the model etc. So, let's see first some manual test and it will give some ideas what to test automatically.

@Reinmar
Copy link
Member Author

Reinmar commented Mar 31, 2017

Interesting aspect of this is that the editor class needs to know to what model element the DOM element on which the editor is create maps.

E.g. if you create the editor on a <p> the root model element used by the editor should be of a $block type. Without the paragraph feature the editor won't even know that <p> must be converted to <paragraph> and that paragraph extends that $block type. However, I don't think that it should actually work through conversion here because we're not converting roots.

It's tricky... :)

@oleq
Copy link
Member

oleq commented Apr 4, 2017

Can't wait to see the demo. It's a killer feature for complex forms and content editing systems.

@VincentClair
Copy link

Hi, do you have some news on ck5 supporting other elements (Hn, P, etc.) than DIV ?
I tried 0.11 without success.

@Reinmar
Copy link
Member Author

Reinmar commented Oct 17, 2017

We didn't work on this yet. We'll check soon if we can give it a try, but I can't promise anything yet (also because we don't know how much work it will require).

@msamsel
Copy link
Contributor

msamsel commented May 23, 2019

@Reinmar I create a PR which adds manual test for inline editor. Test contains editor created over <h1>, <p>, <blockqoute> and <pre> tags.
Does is solves case from this task?

@msamsel
Copy link
Contributor

msamsel commented Jul 9, 2019

@Reinmar more detailed analysis related to this topic.

I add branch t/ckeditor5-editor-inline/5 to ckeditor5 repository, which applies the appropriate modification to the engine and the editor-inline repository. However, there is very little to modify. There is registered a new element in schema $inlineRoot, modification in $text to be allowed in $inlineRoot and change in InlineEditor constructor to use $inlineRoot or $root element based on a configuration option.

There is a manual test editor-inline/tests/manual/inlineroot, which is POC how this works. I've tested it with some of the editor's features and it seems to work really well.

  • I haven't spotted any errors during editor usage in this configuration.
  • All block related features are automatically disabled.
  • Inline features like fonts, basic-styles, highlight, links, etc. are working.
  • Undo and redo is available and works nice.
  • Clipboard paste only inline content. It extracts content even with inline styles and pastes it without blocks.

I noticed one thing, which is rather related to missing feature in the editor. Inline images are removed during upcast. As images in editor became block element and that's why those are lost during conversion.

Screenshot 2019-07-09 at 10 03 55

@Reinmar
Copy link
Member Author

Reinmar commented Sep 5, 2019

OK, thanks guys for the work. It looks great. I concluded our findings in #762 and would like to close this ticket as the ckeditor5's one is more generic. Let's continue there.

@Reinmar Reinmar closed this as completed Sep 5, 2019
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-editor-inline Oct 8, 2019
@mlewand mlewand added resolution:duplicate This issue is a duplicate of another issue and was merged into it. status:confirmed type:task This issue reports a chore (non-production change) and other types of "todos". package:editor-inline labels Oct 8, 2019
@mlewand mlewand removed the resolution:duplicate This issue is a duplicate of another issue and was merged into it. label Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:editor-inline type:task This issue reports a chore (non-production change) and other types of "todos".
Projects
None yet
5 participants