parent
fe315a8290
commit
942e3ee1f9
4 changed files with 37 additions and 1 deletions
|
@ -205,6 +205,7 @@ extra-source-files:
|
|||
test/command/B.txt
|
||||
test/command/C.txt
|
||||
test/command/D.txt
|
||||
test/command/01.csv
|
||||
test/command/defaults1.yaml
|
||||
test/command/defaults2.yaml
|
||||
test/command/3533-rst-csv-tables.csv
|
||||
|
|
|
@ -879,7 +879,12 @@ csvTableDirective top fields rawcsv = do
|
|||
Left e ->
|
||||
throwError $ PandocParsecError "csv table" e
|
||||
Right rawrows -> do
|
||||
let parseCell = parseFromString' (plain <|> return mempty)
|
||||
let singleParaToPlain bs =
|
||||
case B.toList bs of
|
||||
[Para ils] -> B.fromList [Plain ils]
|
||||
_ -> bs
|
||||
let parseCell t = singleParaToPlain
|
||||
<$> parseFromString' parseBlocks (t <> "\n\n")
|
||||
let parseRow = mapM parseCell
|
||||
rows <- mapM parseRow rawrows
|
||||
let (headerRow,bodyRows,numOfCols) =
|
||||
|
|
4
test/command/01.csv
Normal file
4
test/command/01.csv
Normal file
|
@ -0,0 +1,4 @@
|
|||
"Column1";"Column2"
|
||||
"Data1";"- data1
|
||||
|
||||
- data2"
|
|
26
test/command/6549.md
Normal file
26
test/command/6549.md
Normal file
|
@ -0,0 +1,26 @@
|
|||
```
|
||||
% pandoc -f rst
|
||||
.. csv-table:: Test table
|
||||
:file: command/01.csv
|
||||
:delim: ;
|
||||
:header-rows: 1
|
||||
^D
|
||||
<table>
|
||||
<caption>Test table</caption>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Column1</th>
|
||||
<th>Column2</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>Data1</td>
|
||||
<td><ul>
|
||||
<li>data1</li>
|
||||
<li>data2</li>
|
||||
</ul></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
```
|
Loading…
Reference in a new issue