From 4103aaa08a7cbe5d856ebd5a453cdf5f3e51cbb0 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 27 May 2016 14:22:15 +0200 Subject: [PATCH] Fixed #170 - wrap attributes of tags are not removed on "strg+alt+f". --- app/assets/javascripts/app/lib/app_post/utils.coffee | 2 ++ public/assets/tests/html_utils.js | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/app/assets/javascripts/app/lib/app_post/utils.coffee b/app/assets/javascripts/app/lib/app_post/utils.coffee index a79fadd64..ff6737bab 100644 --- a/app/assets/javascripts/app/lib/app_post/utils.coffee +++ b/app/assets/javascripts/app/lib/app_post/utils.coffee @@ -208,6 +208,7 @@ class App.Utils .removeAttr('lang') .removeAttr('type') .removeAttr('id') + .removeAttr('wrap') .removeAttrs(/data-/) html .removeAttr('style') @@ -216,6 +217,7 @@ class App.Utils .removeAttr('lang') .removeAttr('type') .removeAttr('id') + .removeAttr('wrap') .removeAttrs(/data-/) html diff --git a/public/assets/tests/html_utils.js b/public/assets/tests/html_utils.js index 279ec546f..89e7bb8a9 100644 --- a/public/assets/tests/html_utils.js +++ b/public/assets/tests/html_utils.js @@ -304,6 +304,11 @@ test("htmlRemoveTags", function() { result = App.Utils.htmlRemoveRichtext($(source)) equal(result.html(), should, source) + source = "

test 123

" + should = "

test 123

" + result = App.Utils.htmlRemoveRichtext($(source)) + equal(result.html(), should, source) + source = "
This is some text!
" should = "This is some text!" result = App.Utils.htmlRemoveRichtext($(source))