aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-05-15 20:36:11 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-05-15 20:36:11 +0200
commit37189667cc2bc86d308ad771318528bd77876912 (patch)
tree7430b8ed8856b307092b2fd1a9acf2933edfe5c7
parent1e2dc33165a0baf11e64553599887105030f4297 (diff)
downloadpandoc-37189667cc2bc86d308ad771318528bd77876912.tar.gz
Textile reader: fix bug for certain links in table cells.
Closes #3667.
-rw-r--r--src/Text/Pandoc/Readers/Textile.hs7
-rw-r--r--test/command/3667.md13
2 files changed, 18 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs
index df057837f..abf8be452 100644
--- a/src/Text/Pandoc/Readers/Textile.hs
+++ b/src/Text/Pandoc/Readers/Textile.hs
@@ -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
diff --git a/test/command/3667.md b/test/command/3667.md
new file mode 100644
index 000000000..97de8f598
--- /dev/null
+++ b/test/command/3667.md
@@ -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>
+```
+