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

Heading plugin should be disabled when selection in the title #2005

Closed
oskarwrobel opened this issue Aug 28, 2019 · 2 comments · Fixed by ckeditor/ckeditor5-heading#130
Closed
Assignees
Labels
type:bug This issue reports a buggy (incorrect) behavior.

Comments

@oskarwrobel
Copy link
Contributor

Follow-up: #2003

The document title is always represented as a <title /> element in the model. It's not possible to change it to the other block element (post-fixer will always fix such a change).

Commands that try to change title element should be disabled when selection is in the title.

@oskarwrobel oskarwrobel added type:bug This issue reports a buggy (incorrect) behavior. status:confirmed labels Aug 28, 2019
@oskarwrobel oskarwrobel added this to the iteration 27 milestone Aug 28, 2019
@oskarwrobel oskarwrobel self-assigned this Aug 28, 2019
@oskarwrobel oskarwrobel changed the title Heading plugin should be disabled when selection in in the title Heading plugin should be disabled when selection in the title Aug 28, 2019
@oskarwrobel
Copy link
Contributor Author

oskarwrobel commented Aug 29, 2019

In a case of elements that are not allowed to be a title (cannot be renamed to title), it works bad. E.g. after executing one of the list commands, title element is renamed to listItem then postfixer cannot rename it back to title because list cannot be transformed to title. In this case post-fixer creates an empty title before the list item.

<title>F[]oo</title>
editor.execute( 'bulletedList' )

Result:

<title></title>
<listItem listIndent="0" listType="bulleted">F{}oo</listItem>

@oskarwrobel
Copy link
Contributor Author

oskarwrobel commented Sep 2, 2019

We decided to go with the following model structure:

<title>
    <title-content>Title content</title-content>
</title>

It makes it possible to set Schema rules for all elements inside the title element. So, we can disallow all elements except title-content so all commands that could rename title to some other block should be disabled when selection is in the title element.

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

Successfully merging a pull request may close this issue.

1 participant