ti2-tourplan 1.0.73 → 1.0.74
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/index.js +14 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -232,8 +232,20 @@ class BuyerPlugin {
|
|
|
232
232
|
this.escapeInvalidXmlChars = str => {
|
|
233
233
|
if (!str) return '';
|
|
234
234
|
const convertAccentedChars = s => {
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
// according to TC-143, we will go through one mapping first
|
|
236
|
+
// for certain accented chars
|
|
237
|
+
const accentedChars = [
|
|
238
|
+
['Ä', 'Ae'],
|
|
239
|
+
['Ö', 'Oe'],
|
|
240
|
+
['Ü', 'Ue'],
|
|
241
|
+
['ä', 'ae'],
|
|
242
|
+
['ö', 'oe'],
|
|
243
|
+
['ü', 'ue'],
|
|
244
|
+
['ß', 'ss'],
|
|
245
|
+
];
|
|
246
|
+
const preprocessed = accentedChars.reduce((acc, [k, v]) => acc.replace(k, v), s);
|
|
247
|
+
return preprocessed.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
|
248
|
+
};
|
|
237
249
|
return convertAccentedChars(str)
|
|
238
250
|
.replace(/’/g, "'")
|
|
239
251
|
.replace(/‘/g, "'")
|