Skip to content

Commit

Permalink
Allow comments in tiddler field blocks
Browse files Browse the repository at this point in the history
Particularly useful for commenting in tiddler dictionaries
  • Loading branch information
Jeremy Ruston committed Nov 17, 2012
1 parent 705c88d commit 5c9b0d6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,13 @@ $tw.utils.parseStringArray = function(value) {
$tw.utils.parseFields = function(text,fields) {
fields = fields || {};
text.split(/\r?\n/mg).forEach(function(line) {
var p = line.indexOf(":");
if(p !== -1) {
var field = line.substr(0, p).trim(),
value = line.substr(p+1).trim();
fields[field] = value;
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;
Expand Down

0 comments on commit 5c9b0d6

Please sign in to comment.