Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ _.extend(Renderer.prototype, rawRenderer.prototype, {
return line
})
var type = ordered ? '#' : '*'
return _.map(arr, function(line) {
// prefix with a \n to prevent the first child list item being concatenated onto the parent
return '\n' + _.map(arr, function(line) {
// only insert a space if we have terminated any ordered/unordered list demarkation
if (line.match(/^[*#]+\s.*/)) {
return type + line
}
return type + ' ' + line
}).join('\n') + '\n\n'

Expand Down