Textile reader: fix bug for certain links in table cells.

Closes #3667.
This commit is contained in:
John MacFarlane 2017-05-15 20:36:11 +02:00
parent 1e2dc33165
commit 37189667cc
2 changed files with 18 additions and 2 deletions

View file

@ -586,8 +586,9 @@ link = try $ do
char ':'
let stop = if bracketed
then char ']'
else lookAhead $ space <|>
try (oneOf "!.,;:" *> (space <|> newline))
else lookAhead $ space <|> eof' <|>
try (oneOf "!.,;:" *>
(space <|> newline <|> eof'))
url <- many1Till nonspaceChar stop
let name' = if B.toList name == [Str "$"] then B.str url else name
return $ if attr == nullAttr
@ -728,3 +729,5 @@ groupedInlineMarkup = try $ do
singleton :: a -> [a]
singleton x = [x]
eof' :: Monad m => ParserT [Char] s m Char
eof' = '\n' <$ eof

13
test/command/3667.md Normal file
View file

@ -0,0 +1,13 @@
```
% pandoc -f textile
| "link text":http://example.com/ |
^D
<table>
<tbody>
<tr class="odd">
<td><a href="http://example.com/">link text</a></td>
</tr>
</tbody>
</table>
```