[kramdown-users] RFC: Lazy syntax / blank line usage

Thomas Leitner t_leitner at gmx.at
Tue Sep 7 01:17:55 EDT 2010


> However, email clients do not introduce new list item markers when
> wrapping or quoting text.  Also, it is very rare for list item and
> blockquote markers ('1.', '*', '>', etc.) to appear in the middle of
> a line.
> 
> Therefore, it would be very strange for line wrapping or other
> automatic email handling to result in a wrapped line fragment that
> starts with a list item marker.  We can safely infer that a list item
> marker at the start of a line (with optional leading whitespace) is
> intentional, and should yield a new list item block.

I feel the same way. pandoc and PHP Markdown Extra do it also like this.
 
> Any whitespace before a list item marker should also be considered
> intentional, and should determine the indentation level of the list
> item:
> 
> a. Same amount of whitespace as before previous list item marker =>
> same list element (ol/ul) b. More whitespace => new list element
> (ol/ul) contained inside previous line's list item c. Less whitespace
> => close previous line's list element (ol/ul)
> 
> This should allow you to parse list items and nested lists without
> requiring blank lines between the list items.

We probably do not need to change whitespace handling for list items
and can leave it as it is now. But I think I have to implement lazy
support in list items first to really see if any change is needed.

> # Nested Blockquotes
> 
> While parsing line-by-line, kramdown should keep track of the degree
> of nesting in the current block.
> 
> A line starting with more blockquote markers than the previous degree
> of nesting should start a new nested blockquote.
> 
> A line starting with blockquote markers but containing no other
> content should close a more deeply nested previous list or blockquote.

This should not only apply to blockquotes but to all nested paragraphs,
be it a simple paragraph, a nested blockquote or a nested list item!
Therefore, as stated in my last email, I would like to add lazy support
for codeblocks.

-- Thomas


More information about the kramdown-users mailing list