Comparing version 0.19.1-revision11 to 0.19.1-revision12
@@ -204,3 +204,23 @@ // @flow | ||
console.log(XmlBuilder.create(xml).end()); | ||
// The XmlBuilder by default does not remove characters that are | ||
// invalid in XML, like backspaces. However, we can pass it an | ||
// `invalidCharReplacement` option to tell it how to handle | ||
// those characters, rather than crashing. In an attempt to | ||
// retain useful information in the output, we try and output a | ||
// hex-encoded unicode codepoint for the invalid character. For | ||
// example, the start of a terminal escape (`\u{001B}` in Elm) will be output as a | ||
// literal `\u{001B}`. | ||
var invalidCharReplacement = function (char) { | ||
return ( | ||
'\\u{' + | ||
char.codePointAt(0).toString(16).padStart(4, '0') + | ||
'}' | ||
); | ||
}; | ||
console.log( | ||
XmlBuilder.create(xml, { | ||
invalidCharReplacement: invalidCharReplacement, | ||
}).end() | ||
); | ||
} | ||
@@ -207,0 +227,0 @@ } |
{ | ||
"name": "elm-test", | ||
"version": "0.19.1-revision11", | ||
"version": "0.19.1-revision12", | ||
"description": "Run elm-test suites.", | ||
@@ -5,0 +5,0 @@ "main": "elm-test.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
194184
3379