mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
Make sure that inline markups inserted by wiki toolbar are surrounded by whitespaces (#28796).
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@17347 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -305,8 +305,13 @@ jsToolBar.prototype = {
|
||||
end = this.textarea.selectionEnd;
|
||||
scrollPos = this.textarea.scrollTop;
|
||||
sel = this.textarea.value.substring(start, end);
|
||||
if (start > 0 && this.textarea.value.substr(start-1, 1).match(/\S/)) {
|
||||
prefix = ' ' + prefix;
|
||||
}
|
||||
if (this.textarea.value.substr(end, 1).match(/\S/)) {
|
||||
suffix = suffix + ' ';
|
||||
}
|
||||
}
|
||||
|
||||
if (sel.match(/ $/)) { // exclude ending space char, if any
|
||||
sel = sel.substring(0, sel.length - 1);
|
||||
suffix = suffix + " ";
|
||||
|
||||
Reference in New Issue
Block a user