diff options
author | Go MAEDA <maeda@farend.jp> | 2021-08-13 03:10:39 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-08-13 03:10:39 +0000 |
commit | 6bb4b15777e0cd8b04f65659754245d4664a338d (patch) | |
tree | b7805d829ae8fa657ca4671f43f3cdc3fc181639 /public | |
parent | 39e212dd8fc4a2f893ddf29efaa66daa14aad323 (diff) | |
download | redmine-6bb4b15777e0cd8b04f65659754245d4664a338d.tar.gz redmine-6bb4b15777e0cd8b04f65659754245d4664a338d.zip |
Preserve leading spaces when using the Quote function (#35677).
Patch by Jens Krämer.
git-svn-id: http://svn.redmine.org/redmine/trunk@21170 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'public')
-rw-r--r-- | public/javascripts/jstoolbar/markdown.js | 4 | ||||
-rw-r--r-- | public/javascripts/jstoolbar/textile.js | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/public/javascripts/jstoolbar/markdown.js b/public/javascripts/jstoolbar/markdown.js index ae2725269..902babab6 100644 --- a/public/javascripts/jstoolbar/markdown.js +++ b/public/javascripts/jstoolbar/markdown.js @@ -153,7 +153,7 @@ jsToolBar.prototype.elements.bq = { wiki: function() { this.encloseLineSelection('','',function(str) { str = str.replace(/\r/g,''); - return str.replace(/(\n|^) *([^\n]*)/g,"$1> $2"); + return str.replace(/(\n|^)( *)([^\n]*)/g,"$1> $2$3"); }); } } @@ -167,7 +167,7 @@ jsToolBar.prototype.elements.unbq = { wiki: function() { this.encloseLineSelection('','',function(str) { str = str.replace(/\r/g,''); - return str.replace(/(\n|^) *[>]? *([^\n]*)/g,"$1$2"); + return str.replace(/(\n|^) *(> ?)?( *)([^\n]*)/g,"$1$3$4"); }); } } diff --git a/public/javascripts/jstoolbar/textile.js b/public/javascripts/jstoolbar/textile.js index 76d2170cc..bc994d288 100644 --- a/public/javascripts/jstoolbar/textile.js +++ b/public/javascripts/jstoolbar/textile.js @@ -153,7 +153,7 @@ jsToolBar.prototype.elements.bq = { wiki: function() { this.encloseLineSelection('','',function(str) { str = str.replace(/\r/g,''); - return str.replace(/(\n|^) *([^\n]*)/g,"$1> $2"); + return str.replace(/(\n|^)( *)([^\n]*)/g,"$1> $2$3"); }); } } @@ -167,7 +167,7 @@ jsToolBar.prototype.elements.unbq = { wiki: function() { this.encloseLineSelection('','',function(str) { str = str.replace(/\r/g,''); - return str.replace(/(\n|^) *[>]? *([^\n]*)/g,"$1$2"); + return str.replace(/(\n|^) *(> ?)?( *)([^\n]*)/g,"$1$3$4"); }); } } |