Skip to content

Commit

Permalink
Merge pull request #897 from JoelParke/master
Browse files Browse the repository at this point in the history
fix(taBind.js): Improved the fix to handle Apple-converted-space, so that we only remove
  • Loading branch information
JoelParke committed Sep 20, 2015
2 parents 2977bfc + 220ef74 commit f7d34a3
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 f7d34a3

Please sign in to comment.