mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-07-04 11:02:51 +00:00
Allow comments in tiddler field blocks
Particularly useful for commenting in tiddler dictionaries
This commit is contained in:
parent
705c88d1aa
commit
5c9b0d62c4
@ -198,12 +198,14 @@ $tw.utils.parseStringArray = function(value) {
|
|||||||
$tw.utils.parseFields = function(text,fields) {
|
$tw.utils.parseFields = function(text,fields) {
|
||||||
fields = fields || {};
|
fields = fields || {};
|
||||||
text.split(/\r?\n/mg).forEach(function(line) {
|
text.split(/\r?\n/mg).forEach(function(line) {
|
||||||
|
if(line.charAt(0) !== "#") {
|
||||||
var p = line.indexOf(":");
|
var p = line.indexOf(":");
|
||||||
if(p !== -1) {
|
if(p !== -1) {
|
||||||
var field = line.substr(0, p).trim(),
|
var field = line.substr(0, p).trim(),
|
||||||
value = line.substr(p+1).trim();
|
value = line.substr(p+1).trim();
|
||||||
fields[field] = value;
|
fields[field] = value;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return fields;
|
return fields;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user