Improved past in from word/excel.

This commit is contained in:
Martin Edenhofer 2018-01-16 00:29:48 +01:00
parent 7c19f175ff
commit 4c703fb38e
2 changed files with 18 additions and 38 deletions

View file

@ -16,15 +16,9 @@ class App.Utils
'text-align', 'text-align',
'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-collapse', 'border-style', 'border-spacing', 'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-collapse', 'border-style', 'border-spacing',
'border-top-width', 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width',
'border-right-width', 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color',
'border-bottom-width', 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style',
'border-left-width',
'border-top-color',
'border-right-color',
'border-bottom-color',
'border-left-color',
] ]
'TH': [ 'TH': [
'background', 'background-color', 'color', 'font-size', 'vertical-align', 'background', 'background-color', 'color', 'font-size', 'vertical-align',
@ -33,15 +27,10 @@ class App.Utils
'text-align', 'text-align',
'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-collapse', 'border-style', 'border-spacing', 'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-collapse', 'border-style', 'border-spacing',
'border-top-width', 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width',
'border-right-width', 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color',
'border-bottom-width', 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style',
'border-left-width',
'border-top-color',
'border-right-color',
'border-bottom-color',
'border-left-color',
] ]
'TR': [ 'TR': [
'background', 'background-color', 'color', 'font-size', 'vertical-align', 'background', 'background-color', 'color', 'font-size', 'vertical-align',
@ -50,15 +39,10 @@ class App.Utils
'text-align', 'text-align',
'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-collapse', 'border-style', 'border-spacing', 'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-collapse', 'border-style', 'border-spacing',
'border-top-width', 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width',
'border-right-width', 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color',
'border-bottom-width', 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style',
'border-left-width',
'border-top-color',
'border-right-color',
'border-bottom-color',
'border-left-color',
] ]
'TD': [ 'TD': [
'background', 'background-color', 'color', 'font-size', 'vertical-align', 'background', 'background-color', 'color', 'font-size', 'vertical-align',
@ -67,15 +51,10 @@ class App.Utils
'text-align', 'text-align',
'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-collapse', 'border-style', 'border-spacing', 'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-collapse', 'border-style', 'border-spacing',
'border-top-width', 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width',
'border-right-width', 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color',
'border-bottom-width', 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style',
'border-left-width',
'border-top-color',
'border-right-color',
'border-bottom-color',
'border-left-color',
] ]
'IMG': [ 'IMG': [
'width', 'height', 'width', 'height',
@ -235,7 +214,7 @@ class App.Utils
# remove comments # remove comments
@_removeComments(html) @_removeComments(html)
# remove work markup # remove word markup
@_removeWordMarkup(html) @_removeWordMarkup(html)
# remove tags, keep content # remove tags, keep content
@ -256,7 +235,7 @@ class App.Utils
# remove comments # remove comments
@_removeComments(html) @_removeComments(html)
# remove work markup # remove word markup
@_removeWordMarkup(html) @_removeWordMarkup(html)
# remove tags, keep content # remove tags, keep content
@ -280,7 +259,7 @@ class App.Utils
# remove comments # remove comments
@_removeComments(html) @_removeComments(html)
# remove work markup # remove word markup
@_removeWordMarkup(html) @_removeWordMarkup(html)
# remove tags, keep content # remove tags, keep content

View file

@ -74,8 +74,9 @@ window.word_filter = function(editor){
} }
}) })
$('[style]', editor).removeAttr('style'); // style and align is handled by utils.coffee it self, don't clean it here
$('[align]', editor).removeAttr('align'); //$('[style]', editor).removeAttr('style');
//$('[align]', editor).removeAttr('align');
$('span', editor).replaceWith(function() {return $(this).contents();}); $('span', editor).replaceWith(function() {return $(this).contents();});
$('span:empty', editor).remove(); $('span:empty', editor).remove();
$("[class^='Mso']", editor).removeAttr('class'); $("[class^='Mso']", editor).removeAttr('class');