git.iko.soy/typeable/pandoc
on master help sign in
Modified markdown reader to allow ordered list items to begin
7c319e5fiddlosopher
@@ -283,6 +283,35 @@ paragraph. Since "Second" is followed by a list, and not a blank
283line, it isn't treated as a paragraph. The fact that the list
283line, it isn't treated as a paragraph. The fact that the list
284is followed by a blank line is irrelevant.
284is followed by a blank line is irrelevant.
285
285
286+Unlike standard markdown, Pandoc allows ordered list items to be
287+marked with single letters, instead of numbers. So, for example,
288+this source yields a nested ordered list:
289+
290+ 1. First
291+ 2. Second
292+ a. Fee
293+ b. Fie
294+ 3. Third
295+
296+Pandoc also extends standard markdown in allowing list item markers
297+to be terminated by ')':
298+
299+ 1) First
300+ 2) Second
301+ A) Fee
302+ B) Fie
303+ 3) Third
304+
305+Note that Pandoc pays no attention to the *type* of ordered list
306+item marker used. Thus, the following is treated just the same as
307+the example above:
308+
309+ A) First
310+ 1. Second
311+ 2. Fee
312+ B) Fie
313+ C) Third
314+
286## Literal quotes in titles
315## Literal quotes in titles
287
316
288Standard markdown allows unescaped literal quotes in titles, as
317Standard markdown allows unescaped literal quotes in titles, as
src/Text/Pandoc/Readers/Markdown.hs+3−3
@@ -45,7 +45,7 @@ autoLinkEnd = '>'
45mathStart = '$'
45mathStart = '$'
46mathEnd = '$'
46mathEnd = '$'
47bulletListMarkers = "*+-"
47bulletListMarkers = "*+-"
48−orderedListDelimiters = "."
48+orderedListDelimiters = ".)"
49escapeChar = '\\'
49escapeChar = '\\'
50hruleChars = "*-_"
50hruleChars = "*-_"
51quoteChars = "'\""
51quoteChars = "'\""
@@ -276,7 +276,7 @@ orderedListStart =
276 try (do
276 try (do
277 option ' ' newline -- if preceded by a Plain block in a list context
277 option ' ' newline -- if preceded by a Plain block in a list context
278 skipNonindentSpaces
278 skipNonindentSpaces
279− many1 digit
279+ many1 digit <|> count 1 letter
280 oneOf orderedListDelimiters
280 oneOf orderedListDelimiters
281 oneOf spaceChars
281 oneOf spaceChars
282 skipSpaces)
282 skipSpaces)
@@ -535,7 +535,7 @@ title = choice [titleWith '(' ')', titleWith '"' '"', titleWith '\'' '\''] <?> "
535
535
536link = choice [explicitLink, referenceLink] <?> "link"
536link = choice [explicitLink, referenceLink] <?> "link"
537
537
538−explicitLink =
538+explicitLink =
539 try (do
539 try (do
540 label <- reference
540 label <- reference
541 src <- source
541 src <- source