Fixed JavaScript line comments to be parsed as text runs

print-window-tiddler
Jeremy Ruston 2012-06-04 13:39:10 +01:00
rodzic c2927eb032
commit 537c0901e3
1 zmienionych plików z 3 dodań i 5 usunięć

Wyświetl plik

@ -56,15 +56,13 @@ JavaScriptParser.prototype.parse = function(type,code) {
element = "div"; element = "div";
classes.push("javascript-block-comment"); classes.push("javascript-block-comment");
content.push($tw.Tree.Text("/*")); content.push($tw.Tree.Text("/*"));
content.push.apply(content,self.wiki.parseText("text/x-tiddlywiki",text).tree);
content.push($tw.Tree.Text("*/"));
} else { } else {
element = "span"; element = "span";
classes.push("javascript-line-comment"); classes.push("javascript-line-comment");
content.push($tw.Tree.Text("//")); content.push($tw.Tree.Text("//"));
} content.push.apply(content,self.wiki.parseText("text/x-tiddlywiki-run",text).tree);
content.push.apply(content,self.wiki.parseText("text/x-tiddlywiki",text).tree);
if(comment.type === "Block") {
content.push($tw.Tree.Text("*/"));
} else {
content.push($tw.Tree.Text("\n")); content.push($tw.Tree.Text("\n"));
} }
result.push($tw.Tree.Element(element,{"class": classes},content)); result.push($tw.Tree.Element(element,{"class": classes},content));