java-html-sanitizer icon indicating copy to clipboard operation
java-html-sanitizer copied to clipboard

text-decoration properties not supported

Open myin142 opened this issue 4 years ago • 1 comments

It seems like other text-decoration properties are not supported, like text-decoration-line or text-decoration-color. I am using the default CssSchema with common blocks and inline formatting.

new HtmlPolicyBuilder()
    .allowCommonBlockElements()
    .allowCommonInlineFormattingElements()
    .allowStyling()

When sanitizing this HTML, the tag will be removed because the style is not supported.

<span style="text-decoration-line: line-through;">Strikethrough</span>

I think at least text-decoration-line should be supported. Because when someone copies HTML with text-decoration: line-through it gets converted to text-decoration-line: line-through when pasting to an input field. But based on my testing, it happens only from Chrome -> Chrome. If using Firefox on any side, it does not seem to get converted.

myin142 avatar Apr 20 '21 12:04 myin142

Helpful, thanks you!!!

huytg1612 avatar Nov 21 '23 10:11 huytg1612