Update Content Editor Packages
What does this MR do?
This MR upgrades Tiptap packages used by the Content Editor. You can see the list of upgraded packages in the table below. This Tiptap upgrade introduces breaking changes in the InputRule API. An input rule is a mechanism to convert text that the user types into something else, i.e. headings, lists, emojis, etc.
API Breaking changes
In https://github.com/ueberdosis/tiptap/pull/1997, the Input Rule API changed in this way:
// old
markInputRule(/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/gm, this.type)
// new
markInputRule({
find: /(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/gm,
type: this.type,
})
This MR fixes the breaking changes in the Content Editor’s custom extensions. Most of the changes in content_editor/extensions
are switching from the old pattern to the new one
Unit test improvements
We discovered that some of the input rules implemented in the Content Editor didn’t have test coverage. We added new test specs to address this situation and introduced two test helpers: triggerNodeInputRule
and triggerMarkInputRule
. The purpose of these test helpers is making input rule tests more readable and maintainable.
All tests follow the same pattern:
- Create a expected document that we use to validate the input rule applied the correct changes (or wasn’t applied at all).
- Trigger the input rule.
- Assert that the editor document and the expected document are the same.
Does this MR introduce user-facing changes?
No, it doesn’t.
Are there other changes not related to input rules?
Yes, there is one change not related to input rules.
Updated packages
MR created with the help of gitlab-org/frontend/renovate-gitlab-bot
Release Notes
ueberdosis/tiptap
v2.0.0-beta.125
v2.0.0-beta.124
v2.0.0-beta.123
v2.0.0-beta.122
v2.0.0-beta.121
v2.0.0-beta.120
v2.0.0-beta.119
Configuration
-
If you want to rebase/retry this MR, check this box.
This MR has been generated by Renovate Bot.