git.iko.soy/typeable/pandoc
on master help sign in
Added `lists_without_preceding_blankline` extension.

* Added `Ext_lists_without_preceding_blankline` to `Extension` in `Options`. Added this option to `githubMarkdownExtensions`. * Made markdown reader sensitive to this. * Closes #972.

commit5afd373ae45f525ff1eff5e54c1850fe2c614b4b authorJohn MacFarlane <fiddlosopher@gmail.com> dateSat 7 Sep 2013, 09:36 (13 years ago) parent91550dd
3 files changed+7
README+4 src/Text/Pandoc/Options.hs+2 src/Text/Pandoc/Readers/Markdown.hs+1
README+4
@@ -2454,6 +2454,10 @@ in pandoc, but may be enabled by adding `+EXTENSION` to the format
24542454name, where `EXTENSION` is the name of the extension. Thus, for
24552455example, `markdown+hard_line_breaks` is markdown with hard line breaks.
24562456
2457+**Extension: `lists_without_preceding_blankline`**\
2458+Allow a list to occur right after a paragraph, with no intervening
2459+blank space.
2460+
24572461**Extension: `hard_line_breaks`**\
24582462Causes all newlines within a paragraph to be interpreted as hard line
24592463breaks instead of spaces.
src/Text/Pandoc/Options.hs+2
@@ -80,6 +80,7 @@ data Extension =
8080 | Ext_link_attributes -- ^ MMD style reference link attributes
8181 | Ext_autolink_bare_uris -- ^ Make all absolute URIs into links
8282 | Ext_fancy_lists -- ^ Enable fancy list numbers and delimiters
83+ | Ext_lists_without_preceding_blankline -- ^ Allow lists without preceding blank
8384 | Ext_startnum -- ^ Make start number of ordered list significant
8485 | Ext_definition_lists -- ^ Definition lists as in pandoc, mmd, php
8586 | Ext_example_lists -- ^ Markdown-style numbered examples
@@ -169,6 +170,7 @@ githubMarkdownExtensions = Set.fromList
169170 , Ext_intraword_underscores
170171 , Ext_strikeout
171172 , Ext_hard_line_breaks
173+ , Ext_lists_without_preceding_blankline
172174 ]
173175
174176multimarkdownExtensions :: Set Extension
src/Text/Pandoc/Readers/Markdown.hs+1
@@ -1559,6 +1559,7 @@ endline :: MarkdownParser (F Inlines)
15591559endline = try $ do
15601560 newline
15611561 notFollowedBy blankline
1562+ guardDisabled Ext_lists_without_preceding_blankline <|> notFollowedBy listStart
15621563 guardEnabled Ext_blank_before_blockquote <|> notFollowedBy emailBlockQuoteStart
15631564 guardEnabled Ext_blank_before_header <|> notFollowedBy (char '#') -- atx header
15641565 -- parse potential list-starts differently if in a list: