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

Trim javascript module tiddlers to exclude the standard header and footer

This commit is contained in:
Jeremy Ruston 2012-03-02 00:10:39 +00:00
parent 8552f2f894
commit 542561a0fa

View File

@ -200,9 +200,15 @@ var inputTiddlerDOM = function(node) {
},
extractModuleTiddler = function(node) {
if(node.hasAttribute && node.hasAttribute("data-tiddler-title")) {
var text = node.innerHTML,
s = text.indexOf("{"),
e = text.lastIndexOf("}");
if(s !== -1 && e !== -1) {
text = text.substring(s+1,e-1);
}
return {
title: node.getAttribute("data-tiddler-title"),
text: node.innerHTML,
text: text,
type: "application/javascript"
};
} else {