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

Allow comments in tiddler field blocks

Particularly useful for commenting in tiddler dictionaries
This commit is contained in:
Jeremy Ruston 2012-11-17 20:18:03 +00:00
parent 705c88d1aa
commit 5c9b0d62c4

View File

@ -198,12 +198,14 @@ $tw.utils.parseStringArray = function(value) {
$tw.utils.parseFields = function(text,fields) {
fields = fields || {};
text.split(/\r?\n/mg).forEach(function(line) {
if(line.charAt(0) !== "#") {
var p = line.indexOf(":");
if(p !== -1) {
var field = line.substr(0, p).trim(),
value = line.substr(p+1).trim();
fields[field] = value;
}
}
});
return fields;
};