diff --git a/modules/backend/formwidgets/MarkdownEditor.php b/modules/backend/formwidgets/MarkdownEditor.php
index a3329c5fd..ec8a2e757 100644
--- a/modules/backend/formwidgets/MarkdownEditor.php
+++ b/modules/backend/formwidgets/MarkdownEditor.php
@@ -22,6 +22,11 @@ class MarkdownEditor extends FormWidgetBase
*/
public $mode = 'tab';
+ /**
+ * @var bool Render preview with safe markdown.
+ */
+ public $safe = false;
+
//
// Object properties
//
@@ -38,6 +43,7 @@ class MarkdownEditor extends FormWidgetBase
{
$this->fillFromConfig([
'mode',
+ 'safe',
]);
}
@@ -75,11 +81,12 @@ class MarkdownEditor extends FormWidgetBase
public function onRefresh()
{
$value = post($this->getFieldName());
- $previewHtml = Markdown::parse($value);
+ $previewHtml = $this->safe
+ ? Markdown::parseSafe($value)
+ : Markdown::parse($value);
return [
'preview' => $previewHtml
];
}
-
}
diff --git a/modules/system/ServiceProvider.php b/modules/system/ServiceProvider.php
index c1c7df05b..53365f662 100644
--- a/modules/system/ServiceProvider.php
+++ b/modules/system/ServiceProvider.php
@@ -185,6 +185,7 @@ class ServiceProvider extends ModuleServiceProvider
'trans' => ['Lang', 'get'],
'transchoice' => ['Lang', 'choice'],
'md' => ['Markdown', 'parse'],
+ 'md_safe' => ['Markdown', 'parseSafe'],
'time_since' => ['System\Helpers\DateTime', 'timeSince'],
'time_tense' => ['System\Helpers\DateTime', 'timeTense'],
]);
diff --git a/modules/system/classes/MailManager.php b/modules/system/classes/MailManager.php
index 96711eacc..178786b30 100644
--- a/modules/system/classes/MailManager.php
+++ b/modules/system/classes/MailManager.php
@@ -136,7 +136,7 @@ class MailManager
$html = $this->renderTwig($content, $data);
- $html = Markdown::parse($html);
+ $html = Markdown::parseSafe($html);
return $html;
}
diff --git a/modules/system/models/MailBrandSetting.php b/modules/system/models/MailBrandSetting.php
index a35e0311e..3b40bd8d6 100644
--- a/modules/system/models/MailBrandSetting.php
+++ b/modules/system/models/MailBrandSetting.php
@@ -43,13 +43,13 @@ class MailBrandSetting extends Model
const WHITE_COLOR = '#fff';
const BODY_BG = '#f5f8fa';
- const PRIMARY_BG = '#3097d1';
- const POSITIVE_BG = '#2ab27b';
- const NEGATIVE_BG = '#bf5329';
+ const PRIMARY_BG = '#3498db';
+ const POSITIVE_BG = '#31ac5f';
+ const NEGATIVE_BG = '#ab2a1c';
const HEADER_COLOR = '#bbbfc3';
const HEADING_COLOR = '#2f3133';
const TEXT_COLOR = '#74787e';
- const LINK_COLOR = '#3869d4';
+ const LINK_COLOR = '#0181b9';
const FOOTER_COLOR = '#aeaeae';
const BORDER_COLOR = '#edeff2';
const PROMOTION_BORDER_COLOR = '#9ba2ab';
diff --git a/modules/system/models/mailtemplate/fields.yaml b/modules/system/models/mailtemplate/fields.yaml
index f38fe6606..212e93f6b 100644
--- a/modules/system/models/mailtemplate/fields.yaml
+++ b/modules/system/models/mailtemplate/fields.yaml
@@ -34,8 +34,8 @@ secondaryTabs:
content_html:
type: markdown
size: giant
- language: html
tab: system::lang.mail_templates.content_html
+ safe: true
stretch: true
content_text:
diff --git a/modules/system/views/mail/layout-default.htm b/modules/system/views/mail/layout-default.htm
index 4da719f7b..96fe5ac5f 100644
--- a/modules/system/views/mail/layout-default.htm
+++ b/modules/system/views/mail/layout-default.htm
@@ -16,10 +16,10 @@ name = "Default layout"
-
-{% component 'header' %}
-{{ subject }}
-{% endcomponent %}
+
+ {% component 'header' %}
+ {{ subject }}
+ {% endcomponent %}
|
@@ -41,10 +41,10 @@ name = "Default layout"
|
-
-{% component 'footer' %}
-© 2017 {{ appName }}. All rights reserved.
-{% endcomponent %}
+
+ {% component 'footer' %}
+ © 2017 {{ appName }}. All rights reserved.
+ {% endcomponent %}
diff --git a/modules/system/views/mail/partial-footer.htm b/modules/system/views/mail/partial-footer.htm
index a64782166..5e5150fe5 100644
--- a/modules/system/views/mail/partial-footer.htm
+++ b/modules/system/views/mail/partial-footer.htm
@@ -8,7 +8,7 @@ name = "Footer"
diff --git a/modules/system/views/mail/partial-panel.htm b/modules/system/views/mail/partial-panel.htm
index 2318a724b..12f24e3ec 100644
--- a/modules/system/views/mail/partial-panel.htm
+++ b/modules/system/views/mail/partial-panel.htm
@@ -8,7 +8,7 @@ name = "Panel"
|
- {{ body|md }}
+ {{ body|md_safe }}
|
diff --git a/modules/system/views/mail/partial-promotion.htm b/modules/system/views/mail/partial-promotion.htm
index 6f31df700..6302f7b92 100644
--- a/modules/system/views/mail/partial-promotion.htm
+++ b/modules/system/views/mail/partial-promotion.htm
@@ -5,7 +5,7 @@ name = "Promotion"
diff --git a/modules/system/views/mail/partial-subcopy.htm b/modules/system/views/mail/partial-subcopy.htm
index 5ea495e35..4e2c9fc77 100644
--- a/modules/system/views/mail/partial-subcopy.htm
+++ b/modules/system/views/mail/partial-subcopy.htm
@@ -1,7 +1,11 @@
+name = "Subcopy"
+==
+{{ body }}
+==
|
- {{ body|md }}
+ {{ body|md_safe }}
|
diff --git a/modules/system/views/mail/partial-table.htm b/modules/system/views/mail/partial-table.htm
index a5fb6b099..c9ef5d556 100644
--- a/modules/system/views/mail/partial-table.htm
+++ b/modules/system/views/mail/partial-table.htm
@@ -2,4 +2,6 @@ name = "Table"
==
{{ body }}
==
-{{ body|md }}
+
+ {{ body|md_safe }}
+