diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-08-23 04:25:09 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-08-23 04:25:09 +0000 |
commit | f11360f50e9104bb6ac203c14ec7f02c5b844a96 (patch) | |
tree | 106ad85af184e727147c7aa682cd4f94f4b13577 /src | |
parent | e29e5c5944723074f11b1b8a54f7123971a82f6b (diff) | |
download | pandoc-f11360f50e9104bb6ac203c14ec7f02c5b844a96.tar.gz |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 15 |
1 files changed, 9 insertions, 6 deletions
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) |