From 00b148b6148df9ef56961157d1d57c8e3d9eae1e Mon Sep 17 00:00:00 2001 From: Jason Chen Date: Fri, 19 Aug 2016 13:53:10 -0700 Subject: [PATCH] fixes #872 Word places an html comment inside style tag instead of a proper css comment so browsers think it's text --- modules/clipboard.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/clipboard.js b/modules/clipboard.js index 5078e5b61f..325c4a1108 100644 --- a/modules/clipboard.js +++ b/modules/clipboard.js @@ -23,7 +23,8 @@ const CLIPBOARD_CONFIG = [ [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['b', matchAlias.bind(matchAlias, 'bold')], - ['i', matchAlias.bind(matchAlias, 'italic')] + ['i', matchAlias.bind(matchAlias, 'italic')], + ['style', matchIgnore] ]; const STYLE_ATTRIBUTORS = [ @@ -212,6 +213,10 @@ function matchBreak(node, delta) { return delta; } +function matchIgnore(node, delta) { + return new Delta(); +} + function matchNewline(node, delta) { if (isLine(node) && !deltaEndsWith(delta, '\n')) { delta.insert('\n');