git.iko.soy/typeable/pandoc
on master help sign in
Modified markdown reader to allow ordered list items to begin

with (single) letters, as well as numbers. The list item marker may now be terminated either by '.' or by ')'. These extensions to standard markdown are documented in README. git-svn-id: https://pandoc.googlecode.com/svn/trunk@211 788f1e2b-df1e-0410-8736-df70ead52e1b

commit7c319e55ff641b57688297c5e67169ec316235b1 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 16 Dec 2006, 19:43 (20 years ago) parent4ab3eb3
2 files changed+32−3
README+29 src/Text/Pandoc/Readers/Markdown.hs+3−3
README+29
@@ -283,6 +283,35 @@ paragraph. Since "Second" is followed by a list, and not a blank
283283line, it isn't treated as a paragraph. The fact that the list
284284is followed by a blank line is irrelevant.
285285
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+
286315## Literal quotes in titles
287316
288317Standard markdown allows unescaped literal quotes in titles, as
src/Text/Pandoc/Readers/Markdown.hs+3−3
@@ -45,7 +45,7 @@ autoLinkEnd = '>'
4545mathStart = '$'
4646mathEnd = '$'
4747bulletListMarkers = "*+-"
48−orderedListDelimiters = "."
48+orderedListDelimiters = ".)"
4949escapeChar = '\\'
5050hruleChars = "*-_"
5151quoteChars = "'\""
@@ -276,7 +276,7 @@ orderedListStart =
276276 try (do
277277 option ' ' newline -- if preceded by a Plain block in a list context
278278 skipNonindentSpaces
279− many1 digit
279+ many1 digit <|> count 1 letter
280280 oneOf orderedListDelimiters
281281 oneOf spaceChars
282282 skipSpaces)
@@ -535,7 +535,7 @@ title = choice [titleWith '(' ')', titleWith '"' '"', titleWith '\'' '\''] <?> "
535535
536536link = choice [explicitLink, referenceLink] <?> "link"
537537
538−explicitLink =
538+explicitLink =
539539 try (do
540540 label <- reference
541541 src <- source