diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-07-23 01:35:03 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-07-23 01:35:03 +0000 |
commit | 6a6b1a5842e6218168bca1bf6f04c8d395b60441 (patch) | |
tree | fee9968cdfba18ad68ff879fbca164c3b1e0cd88 /src | |
parent | f69d9efc8323b202dc0f333036da1c38a2fd270a (diff) | |
download | pandoc-6a6b1a5842e6218168bca1bf6f04c8d395b60441.tar.gz |
Added support for definition lists to RST reader.
Added a relevant test to the test suite.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@782 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/RST.hs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index 000a8b97a..83c5383bd 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -355,7 +355,21 @@ blockQuote = try (do -- list blocks -- -list = choice [ bulletList, orderedList ] <?> "list" +list = choice [ bulletList, orderedList, definitionList ] <?> "list" + +definitionListItem = try $ do + term <- many1Till inline endline + raw <- indentedBlock True + -- parse the extracted block, which may contain various block elements: + rest <- getInput + setInput $ raw ++ "\n\n" + contents <- parseBlocks + setInput rest + return (normalizeSpaces term, contents) + +definitionList = try $ do + items <- many1 definitionListItem + return (DefinitionList items) -- parses bullet list start and returns its length (inc. following whitespace) bulletListStart = try (do |