Changelog
Version 2.0.0 (breaking)
&
, <
, and >
characters. In addition, quotes "
in attributes are also escaped (see #41). Prior to this, users had to provide their own filter manually. Note that jstoxml
makes an effort not to escape entities that appear to have already been encoded, to prevent double-encoding issues.
toXML({ foo: '1 < 2 & 2 > 1' }); // -> "<foo>1 < 2 & 2 > 1</foo>"
v1.x.x
, simply pass in false
to filter
and attributesFilter
options:
toXML({ foo: '1 < 2 & 2 > 1' }, { filter: false, attributesFilter: false }); // -> "<foo>1 < 2 & 2 > 1</foo>"