-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix 13776: Format is already registered to handle class name #15072
Conversation
This PR will also fix #13687 |
Do you think this is something that should still be part of WordPress 5.2? |
b009f87
to
0f9e0f9
Compare
Thanks @ellatrix, Good catch 👍 |
Yes, it seems like a major inconvenience for plugin developers. |
…rnmobile/887-History-stack-is-not-empty-on-a-fresh-start-of-the-editor * 'master' of https://github.com/WordPress/gutenberg: 'string' misspelled as 'srting' (#15118) [Mobile] Improving accessibility on Post title (#15106) Fix 13776: Format is already registered to handle class name (#15072) Add wpDataSelect WordPress end 2 end test util (#15052) Block Editor: move selection state from RichText to the store (#14640) chore: Fix: Lint error that makes unit tests (and CI tests) fail. (#15073) Set ownProps.onFocus when context.onFocus is undefined. (#15069)
Looks like this did not make it into 5.2. I'm using 5.2-RC1-45273 and I still get the error. |
That's correct. It did not make it for 5.2 . I would assume it could be included in a subsequent minor release (5.2.x), which if I recall correctly from a previous #core dev chat should follow not-long-after the upcoming major release. |
There is an official tutorial in the documentation here with code. One expects that tagName could be set to something like "span" or "strong" or "a", but the "already registered to handle bare tag name" error comes up. How are we to add classes to existing elements, or create multiple custom formats using spans? |
Description
Fixes #13776.
Custom formats are logging this error:
gutenberg/packages/rich-text/src/register-format-type.js
Line 95 in 01be7ac
To Reproduce
Steps to reproduce the behavior:
Example format type to test with:
Props to @pascalknecht for sharing.
Expected behavior
No error logs and all format types are properly registered. In the example provided core link should be there.
Screenshots