Skip to content

Commit

Permalink
MediaWiki reader: allow empty quoted attributes.
Browse files Browse the repository at this point in the history
Closes #10490.
  • Loading branch information
jgm committed Dec 23, 2024
1 parent e122ca0 commit 3c0982c
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Text/Pandoc/Readers/MediaWiki.hs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ parseAttr = try $ do
skipMany spaceChar
char '='
skipMany spaceChar
v <- (char '"' >> many1TillChar (satisfy (/='\n')) (char '"'))
v <- (char '"' >> manyTillChar (satisfy (/='\n')) (char '"'))
<|> many1Char (satisfy $ \c -> not (isSpace c) && c /= '|')
return (k,v)

Expand Down
50 changes: 50 additions & 0 deletions test/command/10490.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
```
% pandoc -f mediawiki -t html
{|class="wikitable" style="text-align: center;"
|-
!rowspan=3 style=""|Witness program version
!colspan=4 style=""|Hash size
|-
!Mainnet
!Testnet
!Mainnet
!Testnet
|-
|0||p2||QW||7Xh||T7n
|-
|1||p4||QY||7Xq||T7w
|}
^D
<table>
<thead>
<tr>
<th style=""><p>Witness program version</p></th>
<th colspan="4" style=""><p>Hash size</p></th>
</tr>
</thead>
<tbody>
<tr>
<td><p>Mainnet</p></td>
<td><p>Testnet</p></td>
<td><p>Mainnet</p></td>
<td><p>Testnet</p></td>
<td></td>
</tr>
<tr>
<td><p>0</p></td>
<td><p>p2</p></td>
<td><p>QW</p></td>
<td><p>7Xh</p></td>
<td><p>T7n</p></td>
</tr>
<tr>
<td><p>1</p></td>
<td><p>p4</p></td>
<td><p>QY</p></td>
<td><p>7Xq</p></td>
<td><p>T7w</p></td>
</tr>
</tbody>
</table>
```

0 comments on commit 3c0982c

Please sign in to comment.