git.iko.soy/typeable/pandoc
on master help sign in
MediaWiki reader: Properly handle :, ::, :::...
bbbbee0John MacFarlane
src/Text/Pandoc/Readers/MediaWiki.hs+6−6
@@ -34,7 +34,6 @@ _ tests for lists
34_ support HTML lists
34_ support HTML lists
35_ support list style attributes and start values in ol lists, also
35_ support list style attributes and start values in ol lists, also
36 value attribute on li
36 value attribute on li
37−_ support :, ::, etc. for indent (treat as list continuation paras?)
38_ support preformatted text (lines starting with space)
37_ support preformatted text (lines starting with space)
39_ support preformatted text blocks
38_ support preformatted text blocks
40_ code highlighting: http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi <syntaxhighlight lang="php"> (alternativel, <source...>)
39_ code highlighting: http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi <syntaxhighlight lang="php"> (alternativel, <source...>)
@@ -207,11 +206,11 @@ listStart c = char c *> notFollowedBy listStartChar
207listStartChar :: MWParser Char
206listStartChar :: MWParser Char
208listStartChar = oneOf "*#;:"
207listStartChar = oneOf "*#;:"
209
208
210−anyListStart :: MWParser ()
209+anyListStart :: MWParser Char
211−anyListStart = skipMany1 (char '*')
210+anyListStart = char '*'
212− <|> skipMany1 (char '#')
211+ <|> char '#'
213− <|> skipMany1 (char ':')
212+ <|> char ':'
214− <|> (() <$ char ';')
213+ <|> char ';'
215
214
216listItem :: Char -> MWParser Blocks
215listItem :: Char -> MWParser Blocks
217listItem c = try $ do
216listItem c = try $ do
@@ -226,6 +225,7 @@ listItem c = try $ do
226 case c of
225 case c of
227 '*' -> return $ B.bulletList contents
226 '*' -> return $ B.bulletList contents
228 '#' -> return $ B.orderedList contents
227 '#' -> return $ B.orderedList contents
228+ ':' -> return $ B.definitionList [(mempty, contents)]
229 _ -> mzero
229 _ -> mzero
230
230
231listItem' :: Char -> MWParser Blocks
231listItem' :: Char -> MWParser Blocks