aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2024-11-19 09:46:34 -0800
committerJohn MacFarlane <[email protected]>2024-11-19 09:46:53 -0800
commitfabfaabd81d47515bb61b1317ebf38b02f0f8bd1 (patch)
tree094f1b52587116c5ddd2214dced5923fb62bf38a
parent323b7e4d6a380c001a54ceb4be826e63b0d78249 (diff)
MediaWiki reader: fix indented tables with caption.
Closes #10390.
-rw-r--r--src/Text/Pandoc/Readers/MediaWiki.hs1
-rw-r--r--test/command/10390.md23
2 files changed, 24 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/MediaWiki.hs b/src/Text/Pandoc/Readers/MediaWiki.hs
index 3af80a336..06e31cfab 100644
--- a/src/Text/Pandoc/Readers/MediaWiki.hs
+++ b/src/Text/Pandoc/Readers/MediaWiki.hs
@@ -209,6 +209,7 @@ table = do
Just w -> fromMaybe 1.0 $ parseWidth w
Nothing -> 1.0
caption <- option mempty tableCaption
+ optional newline
optional rowsep
hasheader <- option False $ True <$ lookAhead (skipSpaces *> char '!')
(cellwidths,hdr) <- unzip <$> tableRow
diff --git a/test/command/10390.md b/test/command/10390.md
new file mode 100644
index 000000000..78d12e874
--- /dev/null
+++ b/test/command/10390.md
@@ -0,0 +1,23 @@
+```
+% pandoc -f mediawiki
+ {| class="wikitable"
+ |+ Overview of basic table markup
+ ! Key
+ |-
+ | Value
+ |}
+^D
+<table>
+<caption>Overview of basic table markup</caption>
+<thead>
+<tr>
+<th><p>Key</p></th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><p>Value</p></td>
+</tr>
+</tbody>
+</table>
+```