-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* TINY-10916: Convert transparent to fully transparent black in Styles.ts * TINY-10916: Add changelog * TINY-10916: Prevent transparent from been converted * TINY-10916: Add and refactor tests * Update .changes/unreleased/tinymce-TINY-10916-2024-05-15.yaml * TINY-10916: Add more test * TINY-10916: Add more tests * TINY-10916: Update rgba regex to do exact match. * TINY-10916: Remove transparent string check (WIP) * TINY-10916: Rever rgba regex to rgb regex * TINY-10916: Lint fix * TINY-10916: Remove global match in rgb regex * TINY-10916: Refactor code, add support and test for new format * Update tinymce-TINY-10916-2024-05-15.yaml * TINY-10916: Update rgba regex * TINY-10916: Add RgbaColour test * TINY-10916: Update rgba regex and test --------- Co-authored-by: Andrew Herron <thespyder@programmer.net> Co-authored-by: spocke <spocke@moxiecode.com>
- Loading branch information
1 parent
2881dc6
commit 29292cc
Showing
5 changed files
with
95 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
project: tinymce | ||
kind: Fixed | ||
body: CSS color values set to `transparent` were incorrectly converted to '#000000`. | ||
time: 2024-05-15T17:05:18.42363+10:00 | ||
custom: | ||
Issue: TINY-10916 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { context, describe, it } from '@ephox/bedrock-client'; | ||
import { Arr } from '@ephox/katamari'; | ||
import { assert } from 'chai'; | ||
|
||
import * as RgbaColour from 'ephox/acid/api/colour/RgbaColour'; | ||
|
||
describe('RgbaColourTest', () => { | ||
context('colour identify', () => { | ||
it('TINY-7480: identify rgb colours', () => { | ||
Arr.each([ | ||
{ colour: 'rgb(0, 0, 0)', expected: 'rgb' }, | ||
{ colour: 'rgba(0, 0, 0, 0)', expected: 'rgba' }, | ||
// rgb with alpha value is invalid | ||
{ colour: 'rgb(0, 0, 0, 0)', expected: 'other' }, | ||
{ colour: 'rgb(0 0 0)', expected: 'rgb' }, | ||
{ colour: 'rgba(0 0 0 0)', expected: 'rgba' }, | ||
// We currently don't support converting this format | ||
{ colour: 'rgb(0 0 0 / 10%)', expected: 'other' }, | ||
], (test) => { | ||
const { colour, expected } = test; | ||
const result = RgbaColour.getColorFormat(colour); | ||
assert.equal(result, expected); | ||
}); | ||
}); | ||
}); | ||
}); |
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