Allow <del> element in editor to correctly format discounted product

[MAILPOET-1843]
This commit is contained in:
Ján Mikláš
2019-04-02 16:55:01 +02:00
committed by Rostislav Wolný
parent b44e573113
commit 42f43e96e1
3 changed files with 3 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ BL.TextEditorBehavior = Marionette.Behavior.extend({
selector: '.mailpoet_content', selector: '.mailpoet_content',
toolbar1: 'bold italic link unlink forecolor mailpoet_shortcodes', toolbar1: 'bold italic link unlink forecolor mailpoet_shortcodes',
toolbar2: '', 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', invalidElements: 'script',
blockFormats: 'Paragraph=p', blockFormats: 'Paragraph=p',
plugins: 'link textcolor colorpicker mailpoet_shortcodes', plugins: 'link textcolor colorpicker mailpoet_shortcodes',

View File

@@ -27,7 +27,7 @@ Module.TextBlockView = base.BlockView.extend({
TextEditorBehavior: { TextEditorBehavior: {
toolbar1: 'formatselect bold italic forecolor | link unlink', toolbar1: 'formatselect bold italic forecolor | link unlink',
toolbar2: 'alignleft aligncenter alignright alignjustify | bullist numlist blockquote | code mailpoet_shortcodes', 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', invalidElements: 'script',
blockFormats: 'Heading 1=h1;Heading 2=h2;Heading 3=h3;Paragraph=p', blockFormats: 'Heading 1=h1;Heading 2=h2;Heading 3=h3;Paragraph=p',
plugins: 'link lists code textcolor colorpicker mailpoet_shortcodes paste', plugins: 'link lists code textcolor colorpicker mailpoet_shortcodes paste',

View File

@@ -298,7 +298,7 @@ class PostTransformer {
$product = wc_get_product($post->ID); $product = wc_get_product($post->ID);
} }
if ($product) { if ($product) {
$price = '<h2>' . $product->get_price_html() . '</h2>'; $price = '<h2>' . strip_tags($product->get_price_html(), '<span><del>') . '</h2>';
} else { } else {
$price = ''; $price = '';
} }