From acc68bc0508ee4dc41c9f6ca5a90d4e3e95acaf5 Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Thu, 29 Mar 2018 14:17:06 +0200 Subject: [PATCH] [Fix #1729] Do not allow tags in template editors --- .../old_design/bootstrap_wysihtml5.js | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/old_design/bootstrap_wysihtml5.js b/app/assets/javascripts/old_design/bootstrap_wysihtml5.js index a100651b3..89f578d02 100644 --- a/app/assets/javascripts/old_design/bootstrap_wysihtml5.js +++ b/app/assets/javascripts/old_design/bootstrap_wysihtml5.js @@ -2,6 +2,36 @@ $(document).on('turbolinks:load', wysihtml5_active); function wysihtml5_active (){ $('.wysihtml5').each(function(i, elem) { - $(elem).wysihtml5({ toolbar:{ "fa": true, "link": false, "color": false }, "locale": "fr-FR" }); + $(elem).wysihtml5({ + toolbar: { + "fa": true, + "link": false, + "color": false + }, + parserRules: { + tags: { + p: {}, + h1: {}, + h2: {}, + h3: {}, + h4: {}, + h5: {}, + h6: {}, + b: {}, + i: {}, + u: {}, + small: {}, + blockquote: {}, + ul: {}, + ol: {}, + li: {}, + img: {}, + code: { + unwrap: 1 + } + } + }, + "locale": "fr-FR" + }); }); }