-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rich text: formats: allow format to filter value when changing tag na…
…me (#35516) * Rich text: formats: allow format to filter value when changing tag name * Do not add a transparent background-color if already set * Fix undefined values in the list of attributes, which would cause the rich-text component to break * Do not skip the entire loop iteration if key does not exist in _attributes * Format library: text-color: Explain use of __unstableFilterAttributeValue * Remove `export` for `parseCSS` * Make sure to delete undefined registeredAttributes * Handle format attributes on rich-text init * Only handle changes for `text-color` formats upon init * Be a bit more defensive when accessing record.current.formats * Prepend the `addedCSS` to prevent double `;` Existing CSS rules already end with a semicolon, and joining it with the `background-color` rule would result in something like: ``` color:#e511be;;background-color:rgba(0, 0, 0, 0) ``` Which is benign AFAIK, but doesn't look right. Best to prepend the `background-color` rule, since it doesn't include a `;`, but the `join` will take care of adding it when joining it with the other existing rules, if any. Co-authored-by: Marcelo Serpa <[email protected]> Co-authored-by: Miguel Fonseca <[email protected]>
- Loading branch information
1 parent
369b65c
commit d4eb1bf
Showing
3 changed files
with
82 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters