-
-
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
Refactor *AutoformatEditing.js #7366
Comments
GitHub Writer already have those and other problems addressed, see https://github.com/ckeditor/github-writer/blob/7aacc28ca6978b319ddbf85f8387025d3629e821/src/app/plugins/autoformat.js We could start by porting its structure back to ckeditor5. The behavior is slightly different but more intuitive in my opinion, for sure it's worth considering. I believe we can also, take the structure keeping the current behavior as well. I reached out @fredck for his comments on that. (I hope he will not mind posting them here)
|
Related: #2400 - there was an idea to re-use |
cc @mlewand |
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue. |
We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it). |
This is a followup after #1239 and #7290 (comment)
Provide a description of the task
During the implementation of #7346 I found a few things that look like a code smell to me:
inlineAutoformatEditing.js
takestestRegexpOrCallback
as an argument, while only regExp is used, and the callback is only used in test suite.In my opinion, this functionality could be dropped.
blockAutoformatEditing
behaves inconsistently when it comes to checking if the command is enabled. Usually, it checks it early on data change, but for headings, it checks it after is performed all the matches. Also,inlineAutoformatEditing
checks it late.In my opinion, it should be checked early for all cases, to avoid pointless computation.
Both
*AutoformatEditing
s basically do (pseudocode):I believe we can make it DRYier, by letting one extend the other, or moving common code to
autoformat.js
, and letinlineAutoformatEditing.js
,blockAutoformatEditing.js
deliver functionality that really differs.📃 Other details
The text was updated successfully, but these errors were encountered: