@@ -177,28 +177,14 @@ para = try $ do
177177
178178-- Tables
179179
180−-- TODO : DOC and factorizing cellInlines
181−
180+-- | A table cell spans until a pipe |
182181tableCell :: GenParser Char ParserState TableCell
183−tableCell = many1 cellInline >>= return . (:[]) . Plain . normalizeSpaces
184− where cellInline = choice [ str
185− , whitespace
186− , code
187− , simpleInline (string "??") (Cite [])
188− , simpleInline (char '*') Strong
189− , simpleInline (char '_') Emph
190− , simpleInline (string "**") Strong
191− , simpleInline (string "__") Emph
192− , simpleInline (char '-') Strikeout
193− , simpleInline (char '+') Inserted
194− , simpleInline (char '^') Superscript
195− , simpleInline (char '~') Subscript
196− -- , link
197− -- , image
198− -- , math
199− -- , autoLink
200− ]
182+tableCell = do
183+ c <- many1 (noneOf "|\n")
184+ content <- parseFromString (many1 inline) c
185+ return $ [ Plain $ normalizeSpaces content ]
201186
187+-- | A table row is made of many table cells
202188tableRow :: GenParser Char ParserState [TableCell]
203189tableRow = try $ do
204190 char '|'
@@ -206,9 +192,11 @@ tableRow = try $ do
206192 newline
207193 return cells
208194
195+-- | Many table rows
209196tableRows :: GenParser Char ParserState [[TableCell]]
210197tableRows = many1 tableRow
211198
199+-- | Table headers are made of cells separated by a tag "|_."
212200tableHeaders :: GenParser Char ParserState [TableCell]
213201tableHeaders = try $ do
214202 let separator = (try $ string "|_.")
@@ -218,6 +206,7 @@ tableHeaders = try $ do
218206 newline
219207 return headers
220208
209+-- | A table with an optional header
221210table :: GenParser Char ParserState Block
222211table = try $ do
223212 headers <- option [] tableHeaders
@@ -251,10 +240,10 @@ inlineParsers = [ str
251240 , endline
252241 , code
253242 , simpleInline (string "??") (Cite [])
254− , simpleInline (char '*') Strong
255− , simpleInline (char '_') Emph
256243 , simpleInline (string "**") Strong
257244 , simpleInline (string "__") Emph
245+ , simpleInline (char '*') Strong
246+ , simpleInline (char '_') Emph
258247 , simpleInline (char '-') Strikeout
259248 , simpleInline (char '+') Inserted
260249 , simpleInline (char '^') Superscript
@@ -311,7 +300,6 @@ simpleInline border construct = surrounded border inline >>=
311300-- - Pandoc Meta Information
312301-- - footnotes
313302-- - hyperlink "label":target
314−-- - tables
315−-- - doc
303+-- - tables alignments
316304-- - tests
317305-- - Inserted inline handling in writers