Skip to content

Commit aba082a

Browse files
authored
Add support for transparent color value for *-color attributes (#214)
1 parent e6d04e3 commit aba082a

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

css/handlers.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ var (
250250
"writing-mode": WritingModeHandler,
251251
"z-index": ZIndexHandler,
252252
}
253-
colorValues = []string{"initial", "inherit", "aliceblue", "antiquewhite",
254-
"aqua", "aquamarine", "azure", "beige", "bisque", "black",
255-
"blanchedalmond", "blue", "blueviolet", "brown", "burlywood",
253+
colorValues = []string{"transparent", "initial", "inherit", "aliceblue",
254+
"antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque",
255+
"black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood",
256256
"cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",
257257
"cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod",
258258
"darkgray", "darkgrey", "darkgreen", "darkkhaki", "darkmagenta",

sanitize_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,6 +1747,10 @@ func TestDefaultStyleHandlers(t *testing.T) {
17471747
in: `<div style="background-color: coral"></div>`,
17481748
expected: `<div style="background-color: coral"></div>`,
17491749
},
1750+
{
1751+
in: `<div style="background-color: transparent"></div>`,
1752+
expected: `<div style="background-color: transparent"></div>`,
1753+
},
17501754
{
17511755
in: `<div style="background-image: url('http://paper.gif')">` +
17521756
`</div><div style="background-image: inherit"></div>`,

0 commit comments

Comments
 (0)