RichText: registerFormatType should allow identification by style rule #15478
Labels
Good First Issue
An issue that's suitable for someone looking to contribute for the first time
Needs Dev
Ready for, and needs developer efforts
[Package] Format library
/packages/format-library
[Package] Rich text
/packages/rich-text
[Type] Enhancement
A suggestion for improvement.
Currently formatting in the content is identified either by "bare" element name (e.g.
strong
) or by class (e.g.span.my-custom-format
). This can be limiting in cases where you can ID formatting by a style property, so you can also ID formatting that existed before Gutenberg, or wasn't applied by your format type. E.g.: underline and color.Rules when matching:
tagName
first.In case of
underline
, the rule istext-decoration
. It's just an implementation detail that we're always going to set it tounderline
. Someone could decide to re-registerunderline
with some style options.For this reason, I'd also rename
core/underline
tocore/text-decoration
.For
color
the above matching also makes sense.Seems like a good first issue to me for anyone wanting to start with rich text. Happy to review it.
The text was updated successfully, but these errors were encountered: