HTML reader: allow tfoot before body rows.

Closes #5079.
This commit is contained in:
John MacFarlane
2018-11-16 11:29:15 -08:00
parent e61f632531
commit d532eb14eb
2 changed files with 19 additions and 2 deletions
+3 -2
View File
@@ -501,10 +501,11 @@ pTable = try $ do
head' <- map snd <$>
pInTag True "tbody"
(if null head'' then pTh else return head'')
topfoot <- option [] $ pInTag False "tfoot" $ many pTr
rowsLs <- many pTBody
rows' <- pInTag True "tfoot" $ many pTr
bottomfoot <- option [] $ pInTag False "tfoot" $ many pTr
TagClose _ <- pSatisfy (matchTagClose "table")
let rows'' = concat rowsLs <> rows'
let rows'' = concat rowsLs <> topfoot <> bottomfoot
let rows''' = map (map snd) rows''
-- let rows''' = map (map snd) rows''
-- fail on empty table
+16
View File
@@ -0,0 +1,16 @@
```
% pandoc -f html -t native
<table>
<tfoot>
</tfoot>
<tbody>
<tr>
<td>Cell</td>
</tr>
</tbody>
</table>
^D
[Table [] [AlignDefault] [0.0]
[[]]
[[[Plain [Str "Cell"]]]]]
```