mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 12:07:19 +00:00
Trim javascript module tiddlers to exclude the standard header and footer
This commit is contained in:
parent
8552f2f894
commit
542561a0fa
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user