aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-03-09 02:37:49 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-03-09 02:37:49 +0000
commitd5f9b1dbb4c1e57b8480afb79753bbd064cecab3 (patch)
tree09f7caaf66eab5ae9bf8e326f612561905fd42d0 /src/Text/Pandoc/Readers
parentf1191f029a24f2f3b0cdb067f28a4aac48c4bc54 (diff)
downloadpandoc-d5f9b1dbb4c1e57b8480afb79753bbd064cecab3.tar.gz
Change in ordered lists in Markdown reader:
+ Lists may begin with lowercase letters only, and only 'a' through 'n'. Otherwise first initials and page references (e.g., p. 400) are too easily parsed as lists. + Numbers beginning list items must end with '.' (not ')', which is now allowed only after letters). NOTE: This change may cause documents to be parsed differently. Users should take care in upgrading. git-svn-id: https://pandoc.googlecode.com/svn/trunk@561 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 067b68e6a..df41e1dd6 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -77,7 +77,6 @@ autoLinkEnd = '>'
mathStart = '$'
mathEnd = '$'
bulletListMarkers = "*+-"
-orderedListDelimiters = ".)"
escapeChar = '\\'
hruleChars = "*-_"
quoteChars = "'\""
@@ -360,14 +359,21 @@ bulletListStart = try (do
spaceChar
skipSpaces)
-orderedListStart = try (do
+standardOrderedListStart = do
+ many1 digit
+ char '.'
+
+extendedOrderedListStart = do
+ failIfStrict
+ oneOf ['a'..'n']
+ oneOf ".)"
+
+orderedListStart = try $ do
option ' ' newline -- if preceded by a Plain block in a list context
nonindentSpaces
- many1 digit <|> (do{failIfStrict; count 1 letter})
- delim <- oneOf orderedListDelimiters
- if delim /= '.' then failIfStrict else return ()
+ standardOrderedListStart <|> extendedOrderedListStart
oneOf spaceChars
- skipSpaces)
+ skipSpaces
-- parse a line of a list item (start = parser for beginning of list item)
listLine start = try (do