From f11360f50e9104bb6ac203c14ec7f02c5b844a96 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Thu, 23 Aug 2007 04:25:09 +0000 Subject: Added new rule for enhanced markdown ordered lists: if the list marker is a capital letter followed by a period (including a single-letter capital roman numeral), then it must be followed by at least two spaces. The point of this is to avoid accidentally treating people's initials as list markers: a paragraph may begin: B. Russell was an English philosopher. and this shouldn't be treated as a list. Modified Markdown reader and README documentation. Added a test case. git-svn-id: https://pandoc.googlecode.com/svn/trunk@880 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Readers/Markdown.hs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 82a82925d..b4302e6e4 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -327,12 +327,15 @@ orderedListStart style delim = try $ do optional newline -- if preceded by a Plain block in a list context nonindentSpaces state <- getState - if stateStrict state - then do many1 digit - char '.' - return 1 - else orderedListMarker style delim - spaceChar + num <- if stateStrict state + then do many1 digit + char '.' + return 1 + else orderedListMarker style delim + if delim == Period && (style == UpperAlpha || (style == UpperRoman && + num `elem` [1, 5, 10, 50, 100, 500, 1000])) + then char '\t' <|> (spaceChar >> spaceChar) + else spaceChar skipSpaces -- parse a line of a list item (start = parser for beginning of list item) -- cgit v1.2.3