summaryrefslogtreecommitdiff
path: root/lib/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scripts')
-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