aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2022-07-28 11:27:27 -0700
committerJohn MacFarlane <[email protected]>2022-07-28 11:28:02 -0700
commitf637ccd3bf9c955b8e92e6f759556bfcb8a33d83 (patch)
treefb9f4327b412e69db393b4670252ccacc4a45c20
parent5c3423f2e2b441f9fe630538906b5fc1436e04f3 (diff)
MediaWiki reader: allow HTML comment after row start.
Closes #8110.
-rw-r--r--src/Text/Pandoc/Readers/MediaWiki.hs5
-rw-r--r--test/command/8110.md41
2 files changed, 45 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/MediaWiki.hs b/src/Text/Pandoc/Readers/MediaWiki.hs
index 2dc289f18..0fdfa8b84 100644
--- a/src/Text/Pandoc/Readers/MediaWiki.hs
+++ b/src/Text/Pandoc/Readers/MediaWiki.hs
@@ -265,7 +265,10 @@ tableEnd = try $ guardColumnOne *> skipSpaces *> sym "|}"
rowsep :: PandocMonad m => MWParser m ()
rowsep = try $ guardColumnOne *> skipSpaces *> sym "|-" <*
- many (char '-') <* optional parseAttrs <* blanklines
+ many (char '-') <* optional parseAttrs
+ <* skipSpaces
+ <* skipMany htmlComment
+ <* blanklines
cellsep :: PandocMonad m => MWParser m ()
cellsep = try $ do
diff --git a/test/command/8110.md b/test/command/8110.md
new file mode 100644
index 000000000..b19d9511c
--- /dev/null
+++ b/test/command/8110.md
@@ -0,0 +1,41 @@
+```
+% pandoc -f mediawiki
+{| class="wikitable"
+! Header text
+! Header text
+! Header text
+
+|-
+| Example
+| Example
+| Example
+
+|- <!-- This is a comment -->
+| Example
+| Example
+| Example
+|}
+^D
+<table>
+<thead>
+<tr class="header">
+<th><p>Header text</p></th>
+<th><p>Header text</p></th>
+<th><p>Header text</p></th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td><p>Example</p></td>
+<td><p>Example</p></td>
+<td><p>Example</p></td>
+</tr>
+<tr class="even">
+<td><p>Example</p></td>
+<td><p>Example</p></td>
+<td><p>Example</p></td>
+</tr>
+</tbody>
+</table>
+
+```