Add support for transparent color value for *-color attributes (#214)
diff --git a/css/handlers.go b/css/handlers.go index 41a00c8..6550d10 100644 --- a/css/handlers.go +++ b/css/handlers.go
@@ -250,9 +250,9 @@ "writing-mode": WritingModeHandler, "z-index": ZIndexHandler, } - colorValues = []string{"initial", "inherit", "aliceblue", "antiquewhite", - "aqua", "aquamarine", "azure", "beige", "bisque", "black", - "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", + colorValues = []string{"transparent", "initial", "inherit", "aliceblue", + "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", + "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgrey", "darkgreen", "darkkhaki", "darkmagenta",
diff --git a/sanitize_test.go b/sanitize_test.go index 1e5607a..8e441bb 100644 --- a/sanitize_test.go +++ b/sanitize_test.go
@@ -1748,6 +1748,10 @@ expected: `<div style="background-color: coral"></div>`, }, { + in: `<div style="background-color: transparent"></div>`, + expected: `<div style="background-color: transparent"></div>`, + }, + { in: `<div style="background-image: url('http://paper.gif')">` + `</div><div style="background-image: inherit"></div>`, expected: `<div style="background-image: ` +