summaryrefslogtreecommitdiff
path: root/lib/scripts/linkwiz.js
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2010-10-02 20:07:34 +0200
committerMichael Hamann <michael@content-space.de>2010-10-02 20:10:13 +0200
commit658296ab9f537037176727350f34a0ec3f2f9bc6 (patch)
tree17f12dda32c3fc133085fac002e33da8f6278d94 /lib/scripts/linkwiz.js
parent15f1b77cd64a0f676733cf10227129deffcc922b (diff)
downloadrpg-658296ab9f537037176727350f34a0ec3f2f9bc6.tar.gz
rpg-658296ab9f537037176727350f34a0ec3f2f9bc6.tar.bz2
Remove trailing whitespace in the link wizard FS#1760
Diffstat (limited to 'lib/scripts/linkwiz.js')
-rw-r--r--lib/scripts/linkwiz.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/scripts/linkwiz.js b/lib/scripts/linkwiz.js
index 225868592..779c4d704 100644
--- a/lib/scripts/linkwiz.js
+++ b/lib/scripts/linkwiz.js
@@ -201,6 +201,13 @@ var linkwiz = {
if(sel.start == 0 && sel.end == 0) sel = linkwiz.selection;
var stxt = sel.getText();
+
+ // don't include trailing space in selection
+ if(stxt.charAt(stxt.length - 1) == ' '){
+ sel.end--;
+ stxt = sel.getText();
+ }
+
if(!stxt && !DOKU_UHC) stxt=title;
// prepend colon inside namespaces for non namespace pages