git.iko.soy/typeable/pandoc
on master help sign in
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

commitd5f9b1dbb4c1e57b8480afb79753bbd064cecab3 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateFri 9 Mar 2007, 02:37 (20 years ago) parentf1191f0
2 files changed+23−18
README+11−12 src/Text/Pandoc/Readers/Markdown.hs+12−6
README+11−12
@@ -394,8 +394,8 @@ behavior is consistent with the official markdown syntax
394394description, even though it is different from that of `Markdown.pl`.)
395395
396396Unlike standard markdown, Pandoc allows ordered list items to be
397−marked with single letters, instead of numbers. So, for example,
398−this source yields a nested ordered list:
397+marked with single lowercase letters (from 'a' to 'n'), instead of
398+numbers. So, for example, this source yields a nested ordered list:
399399
400400 1. First
401401 2. Second
@@ -403,24 +403,23 @@ this source yields a nested ordered list:
403403 b. Fie
404404 3. Third
405405
406−Pandoc also extends standard markdown in allowing list item markers
407−to be terminated by ')':
406+The letters may be followed by either '.' or ')':
408407
409− 1) First
410− 2) Second
411− A) Fee
412− B) Fie
413− 3) Third
408+ 1. First
409+ 2. Second
410+ a) Fee
411+ b) Fie
412+ 3. Third
414413
415414Note that Pandoc pays no attention to the *type* of ordered list
416415item marker used. Thus, the following is treated just the same as
417416the example above:
418417
419− A) First
418+ a) First
420419 1. Second
421420 2. Fee
422− B) Fie
423− C) Third
421+ b) Fie
422+ c. Third
424423
425424Reference links
426425---------------
src/Text/Pandoc/Readers/Markdown.hs+12−6
@@ -77,7 +77,6 @@ autoLinkEnd = '>'
7777mathStart = '$'
7878mathEnd = '$'
7979bulletListMarkers = "*+-"
80−orderedListDelimiters = ".)"
8180escapeChar = '\\'
8281hruleChars = "*-_"
8382quoteChars = "'\""
@@ -360,14 +359,21 @@ bulletListStart = try (do
360359 spaceChar
361360 skipSpaces)
362361
363−orderedListStart = try (do
362+standardOrderedListStart = do
363+ many1 digit
364+ char '.'
365+
366+extendedOrderedListStart = do
367+ failIfStrict
368+ oneOf ['a'..'n']
369+ oneOf ".)"
370+
371+orderedListStart = try $ do
364372 option ' ' newline -- if preceded by a Plain block in a list context
365373 nonindentSpaces
366− many1 digit <|> (do{failIfStrict; count 1 letter})
367− delim <- oneOf orderedListDelimiters
368− if delim /= '.' then failIfStrict else return ()
374+ standardOrderedListStart <|> extendedOrderedListStart
369375 oneOf spaceChars
370− skipSpaces)
376+ skipSpaces
371377
372378-- parse a line of a list item (start = parser for beginning of list item)
373379listLine start = try (do