1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 12:07:19 +00:00

Fixed JavaScript line comments to be parsed as text runs

This commit is contained in:
Jeremy Ruston 2012-06-04 13:39:10 +01:00
parent c2927eb032
commit 537c0901e3

View File

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