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.
print-window-tiddler
Jermolene 2014-11-26 11:13:05 +00:00
rodzic 1600beb193
commit 962cdf500a
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

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