Textile reader: handle block content in cells.

Closes #11455.
This commit is contained in:
John MacFarlane
2026-02-12 21:21:14 +00:00
parent 35638d965f
commit 5db6c52fbd
2 changed files with 32 additions and 2 deletions
+6 -2
View File
@@ -413,8 +413,12 @@ tableCell = try $ do
notFollowedBy blankline
raw <- trim . T.pack <$>
many (noneOf "|\n" <|> try (char '\n' <* notFollowedBy blankline))
content <- mconcat <$> parseFromString' (many inline) raw
return ((isHeader, alignment), B.plain content)
content <- parseFromString' parseBlocks (raw <> "\n\n")
-- Convert lone Para to Plain for backward compatibility
let content' = case B.toList content of
[Para ils] -> B.plain (B.fromList ils)
_ -> content
return ((isHeader, alignment), content')
-- | A table row is made of many table cells
tableRow :: PandocMonad m => TextileParser m [((Bool, Alignment), Blocks)]
+26
View File
@@ -0,0 +1,26 @@
```
% pandoc -f textile -t html
| foo | bar |
| table
* item 1
* item 2
* item 3 | xxx |
^D
<table>
<tbody>
<tr>
<td>foo</td>
<td>bar</td>
</tr>
<tr>
<td><p>table</p>
<ul>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
</ul></td>
<td>xxx</td>
</tr>
</tbody>
</table>
```