-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Create autoformatting engine and command with default config #2367
Comments
When I remove prefix https://github.com/ckeditor/ckeditor5-engine/blob/master/src/model/liveposition.js#L149 This needs a further check, even though I "fixed" it by checking the existence of the |
Above problem was reported (https://github.com/ckeditor/ckeditor5-engine/issues/624) and fixed. |
Some problems were solved and a couple of updates were made to other features to make Autoformat feature work. I think, that instead of separate |
This is not going to work (at least, not always). Features are independent of each other. It's only a convenience why we define But, in fact, I should first ask what's the actual TC? Because I don't see conflicts between those features. They should have exclusive regexp patterns and that's it. |
As a TC I wrote:
Or in details (apostrophes added to stop MD from trimming spaces):
My first idea how to solve it is to make Autoformat aware of patterns and provide with each pattern a check function to check if that particular pattern was applied in current paragraph. So each feature provides a pattern, callback, and check function. This way every feature is still separated, but Autoformat has all the "tools" to decide when to apply formatting and when not. |
What's wrong with behaviour "3"? How often you'd type "1. " at the beginning of a bulleted list? ;) |
The same thing will happen with |
I think this is ok for now. We need MVP and we'll be able to see it in action. However, this is super clear that the support for undo must be correct, so such unwanted autoformatting can be undone. |
Do you see any obvious situation where typing |
:P |
There's no space after "1." in "1.09" ;) Besides, you can always undo that step! |
Besides2, we can change this behaviour easily to only work in paragraphs. Let's have a working solution first, though. |
List of recent changes:
|
TODO: After closing the ticket |
Create lists/headings when line started with
#
or*
or\d
. In the future should also create blockquotes.It should be considered that this feature should not directly require other (link, heading, blockquote) features to exist. So integration must be performed very loosely. Either through a config (e.g. regexp/callback => command/callback) or a set of micro features (which, at this point, can require the link, heading, blockquote ones) which enable the autoformatting for their specific case.
If the engine of the autoformatter will be implemented correctly, the second idea (with specified classes) should be as doable as the declarative config. So the first thing to work on will be a flexible engine.
The text was updated successfully, but these errors were encountered: