mjmlhelper 2.1.0 → 2.1.1

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/mjmlhelper.js +6 -0
  2. package/package.json +1 -1
package/mjmlhelper.js CHANGED
@@ -144,6 +144,12 @@ class mjmlhelper {
144
144
  style_tag = '<style type="text/css">',
145
145
  pos = data.indexOf(style_tag) + style_tag.length;
146
146
 
147
+ // mailchimp has problems with external fonts: when embedding google fonts, we get the error
148
+ // "An error occurred parsing your template CSS: Cannot find a CSS file at: https://fonts.googleapis.com/css?family=Tinos:400"
149
+ // see: https://github.com/sendwithus/templates/issues/21
150
+ // we strip out all occurences of @import (<link href="https://fonts.googleapis.com/..."> is still left behind)
151
+ data = data.replace(/@import url\(https:\/\/fonts.googleapis.com.*\);/g, '');
152
+
147
153
  // when replacing images in mailchimp, style="width:" is set to a fixed size. we prevent this with
148
154
  data = data.substring(0, pos) + ' img { max-width:100%; height:auto !important; } ' + data.substring(pos);
149
155
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mjmlhelper",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "",
5
5
  "main": "mjmlhelper.js",
6
6
  "dependencies": {