Permalink
Browse files

Only include paragraph with indent of 4+ spaces or a tab in a list item

I reverted to the code in the original project [1] for the detection of
whether a paragraph separated from a list item by a space should be
included in a list item.

[1] "Joining only indented stuff after empty lines"
in parse_listitem
in markdown.c
in faelys/libsoldout
https://github.com/faelys/libsoldout/blob/e106f0d74a03fb5edbebe11ce4b46eef7f575456/markdown.c#L1145
  • Loading branch information...
1 parent c8d4650 commit b7d5e017385a8ae35a594ff9535d31bd081ce973 @eric-brechemier eric-brechemier committed Oct 15, 2013
Showing with 2 additions and 4 deletions.
  1. +2 −4 ext/redcarpet/markdown.c
@@ -1893,10 +1893,8 @@ parse_listitem(struct buf *ob, struct sd_markdown *rndr, uint8_t *data, size_t s
if (!sublist)
sublist = work->size;
}
- /* joining only indented stuff after empty lines;
- * note that now we only require 1 space of indentation
- * to continue a list */
- else if (in_empty && pre == 0) {
+ /* joining only indented stuff after empty lines */
+ else if (in_empty && i < 4 && data[beg] != '\t') {
*flags |= MKD_LI_END;
break;
}

0 comments on commit b7d5e01

Please sign in to comment.