v2.0.0
(breaking)
- New: automatic entity escaping for
&,<, and>characters. In addition, quotes"in attributes are also escaped (see #41). Prior to this, users had to provide their own filter manually. Note thatjstoxmlmakes an effort not to escape entities that appear to have already been encoded, to prevent double-encoding issues.- E.g.
toXML({ foo: '1 < 2 & 2 > 1' }); // -> "<foo>1 < 2 & 2 > 1</foo>" - To restore the default behavior from
v1.x.x, simply pass infalsetofilterandattributesFilteroptions:
toXML({ foo: '1 < 2 & 2 > 1' }, { filter: false, attributesFilter: false }); // -> "<foo>1 < 2 & 2 > 1</foo>"
- E.g.