mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-30 07:50:47 +00:00
Fix recipe loading to handle comments
This commit is contained in:
parent
0731135866
commit
a13d30e85a
@ -22,6 +22,9 @@ exports["application/vnd.tiddlywiki2-recipe"] = function(text,fields) {
|
|||||||
parseRecipe = function(text) {
|
parseRecipe = function(text) {
|
||||||
var recipe = [];
|
var recipe = [];
|
||||||
text.toString().split(/\r?\n/mg).forEach(function(line) {
|
text.toString().split(/\r?\n/mg).forEach(function(line) {
|
||||||
|
// Check if the line is a comment
|
||||||
|
if(line.charAt(0) !== "#") {
|
||||||
|
// Find the colon splitting the name from the value
|
||||||
var p = line.indexOf(":");
|
var p = line.indexOf(":");
|
||||||
if(p !== -1) {
|
if(p !== -1) {
|
||||||
recipe.push({
|
recipe.push({
|
||||||
@ -29,6 +32,7 @@ exports["application/vnd.tiddlywiki2-recipe"] = function(text,fields) {
|
|||||||
value: line.substr(p+1).trim()
|
value: line.substr(p+1).trim()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return recipe;
|
return recipe;
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user