git.iko.soy/typeable/pandoc
on master help sign in
Allow spaces before '!' in MediaWiki table header
acd492croblabla
src/Text/Pandoc/Readers/MediaWiki.hs+1−1
@@ -225,7 +225,7 @@ table = do
225 Nothing -> 1.0
225 Nothing -> 1.0
226 caption <- option mempty tableCaption
226 caption <- option mempty tableCaption
227 optional rowsep
227 optional rowsep
228− hasheader <- option False $ True <$ (lookAhead (char '!'))
228+ hasheader <- option False $ True <$ (lookAhead (skipSpaces *> char '!'))
229 (cellspecs',hdr) <- unzip <$> tableRow
229 (cellspecs',hdr) <- unzip <$> tableRow
230 let widths = map ((tableWidth *) . snd) cellspecs'
230 let widths = map ((tableWidth *) . snd) cellspecs'
231 let restwidth = tableWidth - sum widths
231 let restwidth = tableWidth - sum widths
tests/mediawiki-reader.native+5
@@ -252,6 +252,11 @@ Pandoc (Meta {unMeta = fromList []})
252 [[]]
252 [[]]
253 [[[Para [Str "Orange"]]]]
253 [[[Para [Str "Orange"]]]]
254,Para [Str "Paragraph",Space,Str "after",Space,Str "the",Space,Str "table."]
254,Para [Str "Paragraph",Space,Str "after",Space,Str "the",Space,Str "table."]
255+,Table [] [AlignDefault,AlignDefault] [0.0,0.0]
256+ [[Para [Str "fruit"]]
257+ ,[Para [Str "topping"]]]
258+ [[[Para [Str "apple"]]
259+ ,[Para [Str "ice",Space,Str "cream"]]]]
255,Header 2 ("notes",[],[]) [Str "notes"]
260,Header 2 ("notes",[],[]) [Str "notes"]
256,Para [Str "My",Space,Str "note!",Note [Plain [Str "This."]]]
261,Para [Str "My",Space,Str "note!",Note [Plain [Str "This."]]]
257,Para [Str "URL",Space,Str "note.",Note [Plain [Link ("",[],[]) [Str "http://docs.python.org/library/functions.html#range"] ("http://docs.python.org/library/functions.html#range","")]]]]
262,Para [Str "URL",Space,Str "note.",Note [Plain [Link ("",[],[]) [Str "http://docs.python.org/library/functions.html#range"] ("http://docs.python.org/library/functions.html#range","")]]]]
tests/mediawiki-reader.wiki+8
@@ -381,6 +381,14 @@ and cheese
381|Orange
381|Orange
382|}Paragraph after the table.
382|}Paragraph after the table.
383
383
384+{|
385+ !fruit
386+ !topping
387+ |-
388+ |apple
389+ |ice cream
390+ |}
391+
384== notes ==
392== notes ==
385
393
386My note!<ref>This.</ref>
394My note!<ref>This.</ref>