mjmlhelper 2.0.4 → 2.0.8

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/.gitignore CHANGED
File without changes
package/README.md CHANGED
@@ -11,6 +11,7 @@ it also includes a small boilerplate and some nifty updates for mjml.
11
11
  ## installation
12
12
 
13
13
  ```
14
+ npm init -y
14
15
  npm install mjmlhelper
15
16
  ```
16
17
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -5,7 +5,7 @@
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "setup": "mv example.mjmlhelper.json mjmlhelper.json && mv example.gitignore .gitignore",
8
- "watch": "onchange ./*.mjml ./**/*.mjml --initial --wait --delay 100 --await-write-finish 200 -- onerror \"npm run build\" --title \"watch\" --message \"build failed\" --sound mute",
8
+ "watch": "onchange ./*.mjml ./**/*.mjml --initial --poll 50 --delay 0 --await-write-finish 50 -- onerror \"npm run build\" --title \"watch\" --message \"build failed\" --sound mute",
9
9
  "build": "node ./node_modules/mjmlhelper/mjmlhelper.js build",
10
10
  "mail": "node ./node_modules/mjmlhelper/mjmlhelper.js mail",
11
11
  "cleverreach": "node ./node_modules/mjmlhelper/mjmlhelper.js cleverreach",
package/mjmlhelper.js CHANGED
@@ -105,7 +105,10 @@ class mjmlhelper {
105
105
  });
106
106
 
107
107
  // first and last tag
108
- positions = this.findAllPositions(' mj-outlook-group-fix', data);
108
+ positions = this.findAllPositions(' mj-outlook-group-fix', data).concat(
109
+ this.findAllPositions('mj-hero-content', data).concat(
110
+ []));
111
+ positions.sort();
109
112
  shift = 0;
110
113
  positions.forEach(positions__value => {
111
114
  let begin = data.indexOf('>', positions__value + shift) + '>'.length,
@@ -126,6 +129,9 @@ class mjmlhelper {
126
129
  data = data.substring(0, end) + '<!--#/html#-->' + data.substring(end);
127
130
  shift += '<!--#html #-->'.length + '<!--#/html#-->'.length;
128
131
  });
132
+ // prevent nested html tags (cleverreach has problems with that)
133
+ data = data.replace(/(<!--#html #-->)(((?!<!--#\/html#-->).)*(<!--#html #-->))/gs,'$2');
134
+ data = data.replace(/((<!--#\/html#-->)((?!<!--#html #-->).)*)(<!--#\/html#-->)/gs,'$1');
129
135
 
130
136
  return data;
131
137
  }
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "mjmlhelper",
3
- "version": "2.0.4",
3
+ "version": "2.0.8",
4
4
  "description": "",
5
5
  "main": "mjmlhelper.js",
6
6
  "dependencies": {
7
- "@prettier/plugin-php": "^0.14.2",
8
- "archiver": "^3.1.1",
7
+ "@prettier/plugin-php": "^0.16.2",
8
+ "archiver": "^5.3.0",
9
9
  "cli-error-notifier": "^2.1.0",
10
- "fs-extra": "^8.1.0",
10
+ "fs-extra": "^9.1.0",
11
11
  "ftp": "^0.3.10",
12
- "jsdom": "^15.2.0",
13
- "mjml": "^4.5.1",
14
- "nodemailer": "^6.3.1",
15
- "npm": "^6.12.0",
16
- "onchange": "^6.1.0",
17
- "prettier": "^2.0.5"
12
+ "jsdom": "^16.5.1",
13
+ "mjml": "^4.9.0",
14
+ "nodemailer": "^6.5.0",
15
+ "npm": "^7.6.3",
16
+ "onchange": "^7.1.0",
17
+ "prettier": "^2.2.1"
18
18
  },
19
19
  "devDependencies": {},
20
20
  "scripts": {