mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-10-31 23:26:18 +00:00
Fix link dragging to text editors
We were just adding double square brackets if the title contains spaces. We should be adding them if the title is not a valid wikilink.
This commit is contained in:
parent
1600beb193
commit
962cdf500a
@ -155,7 +155,7 @@ LinkWidget.prototype.handleDragStartEvent = function(event) {
|
||||
dataTransfer.clearData();
|
||||
var jsonData = this.wiki.getTiddlerAsJson(this.to),
|
||||
textData = this.wiki.getTiddlerText(this.to,""),
|
||||
title = this.to.indexOf(" ") === -1 ? this.to : "[[" + this.to + "]]";
|
||||
title = (new RegExp("^" + $tw.config.textPrimitives.wikiLink + "$","mg")).exec(this.to) ? this.to : "[[" + this.to + "]]";
|
||||
// IE doesn't like these content types
|
||||
if(!$tw.browser.isIE) {
|
||||
dataTransfer.setData("text/vnd.tiddler",jsonData);
|
||||
|
Loading…
Reference in New Issue
Block a user