Skip to content

Commit 714aec6

Browse files
fix
1 parent 05cfb03 commit 714aec6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

assets/javascripts/view_layouts_base_body_bottom_markdown.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ function styleSelectedText(textarea, prepend, append) {
1111
textarea.val($content);
1212
textarea.focus();
1313
textarea.prop('selectionStart', $start - prepend.length);
14-
textarea.prop('selectionEnd', $end - append.length);
14+
textarea.prop('selectionEnd', $end - prepend.length);
1515
} else {
1616
$content = $content.slice(0, $start) + prepend + $content.slice($start, $end) + append + $content.slice($end, $content.length);
1717
textarea.val($content);
1818
textarea.focus();
1919
textarea.prop('selectionStart', $start + prepend.length);
20-
textarea.prop('selectionEnd', $end + append.length);
20+
textarea.prop('selectionEnd', $end + prepend.length);
2121
}
2222
}
2323

assets/javascripts/view_layouts_base_body_bottom_textile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ function styleSelectedText(textarea, prepend, append) {
1212
textarea.focus();
1313
textarea.prop('selectionStart', $start - prepend.length);
1414
var end =
15-
textarea.prop('selectionEnd', $end - (append == "\n</pre>" ? append.replace("\n", '').length : append.length));
15+
textarea.prop('selectionEnd', $end - prepend.length);
1616
} else {
1717
$content = $content.slice(0, $start) + prepend + $content.slice($start, $end) + append + $content.slice($end, $content.length);
1818
textarea.val($content);
1919
textarea.focus();
2020
textarea.prop('selectionStart', $start + prepend.length);
21-
textarea.prop('selectionEnd', $end + (append == "\n</pre>" ? append.replace("\n", '').length : append.length));
21+
textarea.prop('selectionEnd', $end + prepend.length);
2222
}
2323
}
2424

0 commit comments

Comments
 (0)