ti2-tourplan 1.0.120 → 1.0.121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utils.js +1 -0
- package/utils.test.js +4 -0
package/package.json
CHANGED
package/utils.js
CHANGED
|
@@ -62,6 +62,7 @@ const escapeInvalidXmlChars = str => {
|
|
|
62
62
|
// because js2xmlparser does that for us. Plus if we use sanitize before calling js2xmlparser
|
|
63
63
|
// js2xmlparser will escape & to '&' making it invalid XML
|
|
64
64
|
return convertAccentedChars(asString)
|
|
65
|
+
.replace(/\u00A0/g, ' ')
|
|
65
66
|
.replace(/’/g, "'")
|
|
66
67
|
.replace(/‘/g, "'")
|
|
67
68
|
.replace(/“/g, '"')
|
package/utils.test.js
CHANGED
|
@@ -22,6 +22,10 @@ describe('escapeInvalidXmlChars', () => {
|
|
|
22
22
|
expect(escapeInvalidXmlChars('Say ‘hi’ and “bye” – ok')).toBe('Say \'hi\' and "bye" - ok');
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
+
it('replaces non-breaking spaces with regular spaces', () => {
|
|
26
|
+
expect(escapeInvalidXmlChars('Borwieck\u00A0Mrs R')).toBe('Borwieck Mrs R');
|
|
27
|
+
});
|
|
28
|
+
|
|
25
29
|
it('strips disallowed control characters', () => {
|
|
26
30
|
expect(escapeInvalidXmlChars('A\u0000B\u0008C')).toBe('ABC');
|
|
27
31
|
});
|