Skip to content

Commit

Permalink
fixes #872
Browse files Browse the repository at this point in the history
Word places an html comment inside style tag instead of a proper css
comment so browsers think it's text
  • Loading branch information
jhchen committed Aug 19, 2016
1 parent e8492f2 commit 00b148b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 00b148b

Please sign in to comment.