Parser
Parser copied to clipboard
Empty lines are stripped from comment-blocks too early in the process
For our project we are implementing a custom parser which parses multiline fields with markdown formatting.
Empty lines within markdown denote separation between paragraphs and are therefore important to retain.
I believe this is the part of the code that strips empty lines in the _dss.parse function:
// Remove extra whitespace
block = block.split('\n').filter(function(line) {
return (_dss.trim(_dss.normalize(line)));
}).join('\n');
For other usecases like markup they could be stripped but for flexibility I think it should be left to the custom parsers instead of the initial 'prep' cycle in DSS.