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
This commit is contained in:
parent
f1191f029a
commit
d5f9b1dbb4
2 changed files with 23 additions and 18 deletions
23
README
23
README
|
@ -394,8 +394,8 @@ behavior is consistent with the official markdown syntax
|
|||
description, even though it is different from that of `Markdown.pl`.)
|
||||
|
||||
Unlike standard markdown, Pandoc allows ordered list items to be
|
||||
marked with single letters, instead of numbers. So, for example,
|
||||
this source yields a nested ordered list:
|
||||
marked with single lowercase letters (from 'a' to 'n'), instead of
|
||||
numbers. So, for example, this source yields a nested ordered list:
|
||||
|
||||
1. First
|
||||
2. Second
|
||||
|
@ -403,24 +403,23 @@ this source yields a nested ordered list:
|
|||
b. Fie
|
||||
3. Third
|
||||
|
||||
Pandoc also extends standard markdown in allowing list item markers
|
||||
to be terminated by ')':
|
||||
The letters may be followed by either '.' or ')':
|
||||
|
||||
1) First
|
||||
2) Second
|
||||
A) Fee
|
||||
B) Fie
|
||||
3) Third
|
||||
1. First
|
||||
2. Second
|
||||
a) Fee
|
||||
b) Fie
|
||||
3. Third
|
||||
|
||||
Note that Pandoc pays no attention to the *type* of ordered list
|
||||
item marker used. Thus, the following is treated just the same as
|
||||
the example above:
|
||||
|
||||
A) First
|
||||
a) First
|
||||
1. Second
|
||||
2. Fee
|
||||
B) Fie
|
||||
C) Third
|
||||
b) Fie
|
||||
c. Third
|
||||
|
||||
Reference links
|
||||
---------------
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue