Skip to content

Commit 3c0982c

Browse files
committed
MediaWiki reader: allow empty quoted attributes.
Closes #10490.
1 parent e122ca0 commit 3c0982c

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

src/Text/Pandoc/Readers/MediaWiki.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ parseAttr = try $ do
253253
skipMany spaceChar
254254
char '='
255255
skipMany spaceChar
256-
v <- (char '"' >> many1TillChar (satisfy (/='\n')) (char '"'))
256+
v <- (char '"' >> manyTillChar (satisfy (/='\n')) (char '"'))
257257
<|> many1Char (satisfy $ \c -> not (isSpace c) && c /= '|')
258258
return (k,v)
259259

test/command/10490.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
```
2+
% pandoc -f mediawiki -t html
3+
{|class="wikitable" style="text-align: center;"
4+
|-
5+
!rowspan=3 style=""|Witness program version
6+
!colspan=4 style=""|Hash size
7+
|-
8+
!Mainnet
9+
!Testnet
10+
!Mainnet
11+
!Testnet
12+
|-
13+
|0||p2||QW||7Xh||T7n
14+
|-
15+
|1||p4||QY||7Xq||T7w
16+
|}
17+
^D
18+
<table>
19+
<thead>
20+
<tr>
21+
<th style=""><p>Witness program version</p></th>
22+
<th colspan="4" style=""><p>Hash size</p></th>
23+
</tr>
24+
</thead>
25+
<tbody>
26+
<tr>
27+
<td><p>Mainnet</p></td>
28+
<td><p>Testnet</p></td>
29+
<td><p>Mainnet</p></td>
30+
<td><p>Testnet</p></td>
31+
<td></td>
32+
</tr>
33+
<tr>
34+
<td><p>0</p></td>
35+
<td><p>p2</p></td>
36+
<td><p>QW</p></td>
37+
<td><p>7Xh</p></td>
38+
<td><p>T7n</p></td>
39+
</tr>
40+
<tr>
41+
<td><p>1</p></td>
42+
<td><p>p4</p></td>
43+
<td><p>QY</p></td>
44+
<td><p>7Xq</p></td>
45+
<td><p>T7w</p></td>
46+
</tr>
47+
</tbody>
48+
</table>
49+
50+
```

0 commit comments

Comments
 (0)