@onlineapps/cookbook-template-helpers 1.0.3 → 1.0.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/cookbook-template-helpers",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Template helper functions for cookbook variable resolution - string2file, file2string, and more",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -19,7 +19,9 @@ function normalizeString(value) {
19
19
  // Allow common Latin ranges (including diacritics), numbers, whitespace and basic punctuation
20
20
  const cleaned = str.replace(/[^\x20-\x7E\u00A0-\u024F\u1E00-\u1EFF\s\.\,\!\?\;\:\-\_]/g, '');
21
21
  // Explicitly drop angle brackets to avoid HTML/script injection noise
22
- return cleaned.replace(/[<>]/g, '');
22
+ const noAngles = cleaned.replace(/[<>]/g, '');
23
+ // Collapse repeated whitespace to a single space and trim edges
24
+ return noAngles.replace(/\s+/g, ' ').trim();
23
25
  }
24
26
 
25
27
  /**