btrz-liquid-templates 1.3.0 → 1.4.0

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/package.json +1 -1
  2. package/src/index.js +10 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "btrz-liquid-templates",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Extension and helpers for liquid templates to deal with our data and other things we need to encapsulate",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -34,16 +34,16 @@ function getEngine() {
34
34
  extname: ".liquid",
35
35
  dynamicPartials: false,
36
36
  outputEscape: (val) => {
37
- // if (typeof val === "string") {
38
- // return val.replace(/[\\]/g, '\\\\')
39
- // .replace(/[\"]/g, '\\"')
40
- // .replace(/[\/]/g, '\\/')
41
- // .replace(/[\b]/g, '\\b')
42
- // .replace(/[\f]/g, '\\f')
43
- // .replace(/[\n]/g, '\\n')
44
- // .replace(/[\r]/g, '\\r')
45
- // .replace(/[\t]/g, '\\t');
46
- // }
37
+ if (typeof val === "string") {
38
+ return val.replace(/[\\]/g, '\\\\')
39
+ .replace(/[\"]/g, '\\"')
40
+ .replace(/[\/]/g, '\\/')
41
+ .replace(/[\b]/g, '\\b')
42
+ .replace(/[\f]/g, '\\f')
43
+ .replace(/[\n]/g, '\\n')
44
+ .replace(/[\r]/g, '\\r')
45
+ .replace(/[\t]/g, '\\t');
46
+ }
47
47
  return val;
48
48
  }
49
49
  });