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.
Files changed (2) hide show
  1. package/index.js +14 -2
  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
- return s.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
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, "'")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ti2-tourplan",
3
- "version": "1.0.73",
3
+ "version": "1.0.74",
4
4
  "description": "Tourplan's TI2 Plugin",
5
5
  "main": "index.js",
6
6
  "scripts": {