diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-12-07 08:26:53 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-12-07 08:26:53 +0000 |
commit | 5082b5411bdb1acb5b0dba9cbdfa346b96f1e309 (patch) | |
tree | 4ed4c7934af2ddc82455a301588db3a1151a262f /src/Text/Pandoc/Readers/RST.hs | |
parent | 6ddf8da444351c802ae96101cbc32893e132a5bf (diff) | |
download | pandoc-5082b5411bdb1acb5b0dba9cbdfa346b96f1e309.tar.gz |
Improved syntax for markdown definition lists.
Definition lists are now more compatible with PHP Markdown Extra.
Resolves Issue #24.
+ You can have multiple definitions for a term (but still not
multiple terms).
+ Multi-block definitions no longer need a
column before each block (indeed, this will now cause
multiple definitions).
+ The marker no longer needs to be flush with the left margin,
but can be indented at or two spaces. Also, ~ as well as :
can be used as the marker (this suggestion due to David
Wheeler.)
+ There can now be a blank line between the term and
the definitions.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1656 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Readers/RST.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/RST.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index 9e38b1872..d1515c4d5 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -174,7 +174,7 @@ fieldList = try $ do else do terms <- mapM (return . (:[]) . Str . fst) remaining defs <- mapM (parseFromString (many block) . snd) remaining - return $ DefinitionList $ zip terms defs + return $ DefinitionList $ zip terms $ map (:[]) defs -- -- line block @@ -397,7 +397,7 @@ blockQuote = do list :: GenParser Char ParserState Block list = choice [ bulletList, orderedList, definitionList ] <?> "list" -definitionListItem :: GenParser Char ParserState ([Inline], [Block]) +definitionListItem :: GenParser Char ParserState ([Inline], [[Block]]) definitionListItem = try $ do -- avoid capturing a directive or comment notFollowedBy (try $ char '.' >> char '.') @@ -405,7 +405,7 @@ definitionListItem = try $ do raw <- indentedBlock -- parse the extracted block, which may contain various block elements: contents <- parseFromString parseBlocks $ raw ++ "\n\n" - return (normalizeSpaces term, contents) + return (normalizeSpaces term, [contents]) definitionList :: GenParser Char ParserState Block definitionList = many1 definitionListItem >>= return . DefinitionList |