From 52125148187a01346dbe74279495feabb9d796fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 24 Sep 2019 11:12:13 +0200 Subject: [PATCH] lets allow classes and h1,h2,h3,h4,h5,h6 no matter the configuration. --- .../src/common/services/tinymce.service.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js index def020f8f6..8b0965d950 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js @@ -364,7 +364,9 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s init_instance_callback: initEvents }; - // We keep spans here, cause removing spans here also removes b-tags inside of them, instead we strip them out later. + /* + // We are not ready to limit the pasted elements further than default, we will return to this feature. ( TODO: Make this feature an option. ) + // We keep spans here, cause removing spans here also removes b-tags inside of them, instead we strip them out later. (TODO: move this definition to the config file... ) var validPasteElements = "-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody,img[src|alt|width|height],ul,ol,li,hr,pre,dl,dt,figure,figcaption,wbr" // add elements from user configurated styleFormats to our list of validPasteElements. @@ -376,14 +378,18 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s validPasteElements += "," + style.block; } } + */ + /** + The default paste config can be overwritten by defining these properties in the customConfig. + */ var pasteConfig = { paste_remove_styles: true, paste_text_linebreaktype: true, //Converts plaintext linebreaks to br or p elements. - paste_strip_class_attributes: "all", + paste_strip_class_attributes: "none", - paste_word_valid_elements: validPasteElements, + //paste_word_valid_elements: validPasteElements, paste_preprocess: cleanupPasteData