From 42f43e96e1e27988fb0f6267180a4ee8da4fafa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=CC=81n=20Mikla=CC=81s=CC=8C?= Date: Tue, 2 Apr 2019 16:55:01 +0200 Subject: [PATCH] Allow element in editor to correctly format discounted product [MAILPOET-1843] --- assets/js/src/newsletter_editor/behaviors/TextEditorBehavior.js | 2 +- assets/js/src/newsletter_editor/blocks/text.js | 2 +- lib/Newsletter/Editor/PostTransformer.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/src/newsletter_editor/behaviors/TextEditorBehavior.js b/assets/js/src/newsletter_editor/behaviors/TextEditorBehavior.js index 13c7baa5a0..bbe15b939d 100644 --- a/assets/js/src/newsletter_editor/behaviors/TextEditorBehavior.js +++ b/assets/js/src/newsletter_editor/behaviors/TextEditorBehavior.js @@ -14,7 +14,7 @@ BL.TextEditorBehavior = Marionette.Behavior.extend({ selector: '.mailpoet_content', toolbar1: 'bold italic link unlink forecolor mailpoet_shortcodes', toolbar2: '', - validElements: 'p[class|style],span[class|style],a[href|class|title|target|style],strong[class|style],em[class|style],strike,br', + validElements: 'p[class|style],span[class|style],a[href|class|title|target|style],strong[class|style],em[class|style],strike,br,del', invalidElements: 'script', blockFormats: 'Paragraph=p', plugins: 'link textcolor colorpicker mailpoet_shortcodes', diff --git a/assets/js/src/newsletter_editor/blocks/text.js b/assets/js/src/newsletter_editor/blocks/text.js index 55e14ff80d..9326f18589 100644 --- a/assets/js/src/newsletter_editor/blocks/text.js +++ b/assets/js/src/newsletter_editor/blocks/text.js @@ -27,7 +27,7 @@ Module.TextBlockView = base.BlockView.extend({ TextEditorBehavior: { toolbar1: 'formatselect bold italic forecolor | link unlink', toolbar2: 'alignleft aligncenter alignright alignjustify | bullist numlist blockquote | code mailpoet_shortcodes', - validElements: 'p[class|style],span[class|style],a[href|class|title|target|style],h1[class|style],h2[class|style],h3[class|style],ol[class|style],ul[class|style],li[class|style],strong[class|style],em[class|style],strike,br,blockquote[class|style],table[class|style],tr[class|style],th[class|style],td[class|style]', + validElements: 'p[class|style],span[class|style],a[href|class|title|target|style],h1[class|style],h2[class|style],h3[class|style],ol[class|style],ul[class|style],li[class|style],strong[class|style],em[class|style],strike,br,blockquote[class|style],table[class|style],tr[class|style],th[class|style],td[class|style],del', invalidElements: 'script', blockFormats: 'Heading 1=h1;Heading 2=h2;Heading 3=h3;Paragraph=p', plugins: 'link lists code textcolor colorpicker mailpoet_shortcodes paste', diff --git a/lib/Newsletter/Editor/PostTransformer.php b/lib/Newsletter/Editor/PostTransformer.php index 087e58c8b5..5072ce285c 100644 --- a/lib/Newsletter/Editor/PostTransformer.php +++ b/lib/Newsletter/Editor/PostTransformer.php @@ -298,7 +298,7 @@ class PostTransformer { $product = wc_get_product($post->ID); } if ($product) { - $price = '

' . $product->get_price_html() . '

'; + $price = '

' . strip_tags($product->get_price_html(), '') . '

'; } else { $price = ''; }