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:
Go MAEDA
2018-05-23 01:26:03 +00:00
parent 09dafbf797
commit 1906cd6b29
2 changed files with 7 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@@ -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 + " ";