js-xss icon indicating copy to clipboard operation
js-xss copied to clipboard

why i use xssFilter({ css: false }) is not take effect?

Open caoyanxuan opened this issue 2 years ago • 3 comments

var myxss = new xss.FilterXSS({
  css: false,
});

myxss(<span style=\"color:#f39c12\">123</span>) // => <span>123</span>  i need style attr

caoyanxuan avatar Jul 27 '21 07:07 caoyanxuan

me too!

Statfine avatar Jul 27 '21 11:07 Statfine

By default any style attribute is removed, so you also need to allow it.

From the README.md

If you allow the attribute style, the value will be processed by cssfilter module.

dertieran avatar Aug 02 '21 14:08 dertieran

me too!

guestccc avatar Jan 16 '23 08:01 guestccc