git.iko.soy/typeable/pandoc
on master help sign in
Allow spaces before '!' in MediaWiki table header
commitacd492c7f49e31f65ec044ce3ba66ffb80844e27 authorroblabla <robinlambertz+dev@gmail.com> dateMon 9 May 2016, 15:22 (10 years ago) parent21d1a3b
3 files changed+14−1
src/Text/Pandoc/Readers/MediaWiki.hs+1−1 tests/mediawiki-reader.native+5 tests/mediawiki-reader.wiki+8
src/Text/Pandoc/Readers/MediaWiki.hs+1−1
@@ -225,7 +225,7 @@ table = do
225225 Nothing -> 1.0
226226 caption <- option mempty tableCaption
227227 optional rowsep
228− hasheader <- option False $ True <$ (lookAhead (char '!'))
228+ hasheader <- option False $ True <$ (lookAhead (skipSpaces *> char '!'))
229229 (cellspecs',hdr) <- unzip <$> tableRow
230230 let widths = map ((tableWidth *) . snd) cellspecs'
231231 let restwidth = tableWidth - sum widths
tests/mediawiki-reader.native+5
@@ -252,6 +252,11 @@ Pandoc (Meta {unMeta = fromList []})
252252 [[]]
253253 [[[Para [Str "Orange"]]]]
254254,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"]]]]
255260,Header 2 ("notes",[],[]) [Str "notes"]
256261,Para [Str "My",Space,Str "note!",Note [Plain [Str "This."]]]
257262,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
381381|Orange
382382|}Paragraph after the table.
383383
384+{|
385+ !fruit
386+ !topping
387+ |-
388+ |apple
389+ |ice cream
390+ |}
391+
384392== notes ==
385393
386394My note!<ref>This.</ref>