Skip to content

Commit

Permalink
Improved the fix to handle Apple-converted-space, so that we only remove
Browse files Browse the repository at this point in the history
 the <span...></span> entries when they are now NOT Apple-converted-space
 spans.
  • Loading branch information
JoelParke committed Sep 20, 2015
1 parent edabbde commit 220ef74
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/taBind.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,9 @@ angular.module('textAngular.taBind', ['textAngular.factories', 'textAngular.DOM'
// in case of pasting only a span - chrome paste, remove them. THis is just some wierd formatting
// if we remove the '<span class="Apple-converted-space"> </span>' here we destroy the spacing
// on paste from even ourselves!
//text = text.replace(/(<span class=\"Apple-converted-space\">.<\/span>)/ig, '&nbsp;');
//text = text.replace(/<(|\/)span[^>]*?>/ig, '');
if (!text.match(/<span class=(\"Apple-converted-space\"|\'Apple-converted-space\')>.<\/span>/ig)) {
text = text.replace(/<(|\/)span[^>]*?>/ig, '');
}
}
// Webkit on Apple tags
text = text.replace(/<br class="Apple-interchange-newline"[^>]*?>/ig, '').replace(/<span class="Apple-converted-space">( |&nbsp;)<\/span>/ig, '&nbsp;');
Expand Down

0 comments on commit 220ef74

Please sign in to comment.