-
-
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
Block autoformat could work in all kind of blocks #6170
Comments
After using this app for some time I feel that this is the expected way of doing things. IIRC I just used this app this way (might be a hint from a tutorial). It feels natural. Even so, then when testing our implementation of block autoformat it felt weird in that regard. ps.: This change shouldn't be a time consuming one. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
We did a quick review of the block autoformat code and there are a couple of things that might be worth at least considering when working on this:
|
One thing I noticed in Notion is that `1. ` will work in a paragraph but not in a heading. While `# ` will work everywhere. That even makes some sense, so we should be careful to not "overdo" here. |
Cleaned up the issue a bit (extracted #7517). Also we need more elaboration on that:
|
It's about https://github.com/ckeditor/ckeditor5/blob/b80c677/packages/ckeditor5-autoformat/src/autoformat.js#L120-L139. It'd be cleaner if we read the
It's most likely about https://github.com/ckeditor/ckeditor5/blob/b80c677/packages/ckeditor5-autoformat/src/autoformat.js#L126. It's not a command value. Since we planned to review this code, it might be a good moment to clean up such issues. But it's again a minor issue.
It's about using the |
We had a quick discussion regarding these changes today, and we made several minor adjustments.
Wile mentioned Notion doesn't allow turning a list to a header, we decided to simplify things and not impose such limitations for now. Which means there is not going to be any map telling what block can be turned into what. While doing this issue we could also do some refactoring here and there (e.g. #7366, there are also some misused variable names in the code). However for now the refactoring should be limited, so we're not going to utilize text watcher / perform a full rewrite. |
|
Feature (autoformat): Block autoformat can also be triggered in blocks other than paragraph. Closes #6170. Feature (autoformat): Enabled autoformat feature also for blocks that are not empty.
📝 Provide a description of the improvement
So, right now when you're in at the beginning of a heading 2 and type
###
it is not going to change it to a heading 3. It's only possible to turn a paragraph into other types of blocks.This means that you can't easily toggle between block types. Also, if you made a mistake, you need to get back to a paragraph (e.g. by undoing) and only then you can use autoformatting.
One example of an application where you can always switch between block types is Notion and I use this quite a lot. Especially when I'm changing heading levels (cause I'm reorganizing a document).
Another aspect is that currently you can only apply autoformatting to an empty block. We'd also like to apply formatting for blocks that have some content in it, as long as your cursor is at the beginning of the line.
Related issue:
cc @jodator @panr @oleq
If you'd like to see this improvement implemented, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: