1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 12:07:19 +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:
Jermolene 2014-11-26 11:13:05 +00:00
parent 1600beb193
commit 962cdf500a

View File

@ -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);