mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-07-03 18:42:50 +00:00
Allow comments in tiddler field blocks
Particularly useful for commenting in tiddler dictionaries
This commit is contained in:
parent
705c88d1aa
commit
5c9b0d62c4
12
core/boot.js
12
core/boot.js
@ -198,11 +198,13 @@ $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) {
|
||||||
var p = line.indexOf(":");
|
if(line.charAt(0) !== "#") {
|
||||||
if(p !== -1) {
|
var p = line.indexOf(":");
|
||||||
var field = line.substr(0, p).trim(),
|
if(p !== -1) {
|
||||||
value = line.substr(p+1).trim();
|
var field = line.substr(0, p).trim(),
|
||||||
fields[field] = value;
|
value = line.substr(p+1).trim();
|
||||||
|
fields[field] = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return fields;
|
return fields;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user