git.iko.soy/typeable/pandoc
on master help sign in
Added `lists_without_preceding_blankline` extension.
5afd373John MacFarlane
@@ -2454,6 +2454,10 @@ in pandoc, but may be enabled by adding `+EXTENSION` to the format
2454name, where `EXTENSION` is the name of the extension. Thus, for
2454name, where `EXTENSION` is the name of the extension. Thus, for
2455example, `markdown+hard_line_breaks` is markdown with hard line breaks.
2455example, `markdown+hard_line_breaks` is markdown with hard line breaks.
2456
2456
2457+**Extension: `lists_without_preceding_blankline`**\
2458+Allow a list to occur right after a paragraph, with no intervening
2459+blank space.
2460+
2457**Extension: `hard_line_breaks`**\
2461**Extension: `hard_line_breaks`**\
2458Causes all newlines within a paragraph to be interpreted as hard line
2462Causes all newlines within a paragraph to be interpreted as hard line
2459breaks instead of spaces.
2463breaks instead of spaces.
src/Text/Pandoc/Options.hs+2
@@ -80,6 +80,7 @@ data Extension =
80 | Ext_link_attributes -- ^ MMD style reference link attributes
80 | Ext_link_attributes -- ^ MMD style reference link attributes
81 | Ext_autolink_bare_uris -- ^ Make all absolute URIs into links
81 | Ext_autolink_bare_uris -- ^ Make all absolute URIs into links
82 | Ext_fancy_lists -- ^ Enable fancy list numbers and delimiters
82 | Ext_fancy_lists -- ^ Enable fancy list numbers and delimiters
83+ | Ext_lists_without_preceding_blankline -- ^ Allow lists without preceding blank
83 | Ext_startnum -- ^ Make start number of ordered list significant
84 | Ext_startnum -- ^ Make start number of ordered list significant
84 | Ext_definition_lists -- ^ Definition lists as in pandoc, mmd, php
85 | Ext_definition_lists -- ^ Definition lists as in pandoc, mmd, php
85 | Ext_example_lists -- ^ Markdown-style numbered examples
86 | Ext_example_lists -- ^ Markdown-style numbered examples
@@ -169,6 +170,7 @@ githubMarkdownExtensions = Set.fromList
169 , Ext_intraword_underscores
170 , Ext_intraword_underscores
170 , Ext_strikeout
171 , Ext_strikeout
171 , Ext_hard_line_breaks
172 , Ext_hard_line_breaks
173+ , Ext_lists_without_preceding_blankline
172 ]
174 ]
173
175
174multimarkdownExtensions :: Set Extension
176multimarkdownExtensions :: Set Extension
src/Text/Pandoc/Readers/Markdown.hs+1
@@ -1559,6 +1559,7 @@ endline :: MarkdownParser (F Inlines)
1559endline = try $ do
1559endline = try $ do
1560 newline
1560 newline
1561 notFollowedBy blankline
1561 notFollowedBy blankline
1562+ guardDisabled Ext_lists_without_preceding_blankline <|> notFollowedBy listStart
1562 guardEnabled Ext_blank_before_blockquote <|> notFollowedBy emailBlockQuoteStart
1563 guardEnabled Ext_blank_before_blockquote <|> notFollowedBy emailBlockQuoteStart
1563 guardEnabled Ext_blank_before_header <|> notFollowedBy (char '#') -- atx header
1564 guardEnabled Ext_blank_before_header <|> notFollowedBy (char '#') -- atx header
1564 -- parse potential list-starts differently if in a list:
1565 -- parse potential list-starts differently if in a list: