Skip to content

Commit

Permalink
Move Chrome cleanup in paste extension
Browse files Browse the repository at this point in the history
  • Loading branch information
j0k3r committed Aug 6, 2015
1 parent b83932c commit 36de018
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 5 additions & 2 deletions src/js/extensions/paste.js
Expand Up @@ -12,7 +12,6 @@ var PasteHandler;
*/
function createReplacements() {
return [

// replace two bogus tags that begin pastes from google docs
[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi), ''],
[new RegExp(/<\/b>(<br[^>]*>)?$/gi), ''],
Expand Down Expand Up @@ -42,7 +41,11 @@ var PasteHandler;
[new RegExp(/\n+<p/gi), '<p'],

// Microsoft Word makes these odd tags, like <o:p></o:p>
[new RegExp(/<\/?o:[a-z]*>/gi), '']
[new RegExp(/<\/?o:[a-z]*>/gi), ''],

// cleanup comments added by Chrome when pasting html
['<!--EndFragment-->', ''],
['<!--StartFragment-->', '']
];
}
/*jslint regexp: false*/
Expand Down
5 changes: 0 additions & 5 deletions src/js/util.js
Expand Up @@ -324,11 +324,6 @@ var Util;
insertHTMLCommand: function (doc, html) {
var selection, range, el, fragment, node, lastNode, toReplace;

// cleanup fragment comment created by Chrome
html = html
.replace('<!--EndFragment-->', '')
.replace('<!--StartFragment-->', '');

if (doc.queryCommandSupported('insertHTML')) {
try {
return doc.execCommand('insertHTML', false, html);
Expand Down

0 comments on commit 36de018

Please sign in to comment.