Skip to content
Browse files

* Fixed a bug that causes any browser running under Microsoft Interne…

…t Explorer to append an additional space before textile closing element (Thanks to Lorenzo Monaco).

Signed-off-by: felttippin <ryan@aisleten.com>
  • Loading branch information...
1 parent 2c896d3 commit 254e9ec32b7447d738cc7a1d1d1a34545d7cd74e @weppos weppos committed with
Showing with 9 additions and 0 deletions.
  1. +9 −0 assets/javascripts/textile-editor.js
View
9 assets/javascripts/textile-editor.js
@@ -266,6 +266,15 @@ TextileEditor.Methods = {
newlineEndPos = 1;
}
+ // remove space from the end of the selectedText.
+ // Fixes a bug that causes any browser running under Microsoft Internet Explorer
+ // to append an additional space before the closing element.
+ // *Bold text *here => *Bold text*
+ if (selectedText.match(/\s$/g)) {
+ selectedText = selectedText.replace(/\s$/g,'');
+ followupText = ' ';
+ }
+
// no clue, i'm sure it made sense at the time i wrote it
if (followupText.match(/^\n/)) {
newlineFollowup = '';

0 comments on commit 254e9ec

Please sign in to comment.
Something went wrong with that request. Please try again.