diff options
author | Hakan Sandell <hakan.sandell@home.se> | 2010-10-03 14:16:13 +0200 |
---|---|---|
committer | Hakan Sandell <hakan.sandell@home.se> | 2010-10-03 14:16:13 +0200 |
commit | 7cceaa7443c80b526a6bbad32b6cbdf5d759fd39 (patch) | |
tree | 37b75aab8bf88ad11745c8abe37ec6ebb8d68e8c /lib/scripts/linkwiz.js | |
parent | 831c10d03192413b75ee2be21fb314e0797fdc23 (diff) | |
parent | c1e6807d8013592efafd00472f75ea08dc7347ec (diff) | |
download | rpg-7cceaa7443c80b526a6bbad32b6cbdf5d759fd39.tar.gz rpg-7cceaa7443c80b526a6bbad32b6cbdf5d759fd39.tar.bz2 |
Merge branch 'master' of git://github.com/splitbrain/dokuwiki
Diffstat (limited to 'lib/scripts/linkwiz.js')
-rw-r--r-- | lib/scripts/linkwiz.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/scripts/linkwiz.js b/lib/scripts/linkwiz.js index 225868592..e4e92cdd2 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 @@ -218,6 +225,8 @@ var linkwiz = { pasteText(sel,link,{startofs: so, endofs: eo}); linkwiz.hide(); + // reset the entry to the parent namespace and remove : at the beginning + linkwiz.entry.value = linkwiz.entry.value.replace(/(^:)?[^:]*$/, ''); }, /** |