From 37189667cc2bc86d308ad771318528bd77876912 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 15 May 2017 20:36:11 +0200 Subject: Textile reader: fix bug for certain links in table cells. Closes #3667. --- src/Text/Pandoc/Readers/Textile.hs | 7 +++++-- test/command/3667.md | 13 +++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 test/command/3667.md 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 + + + + + + +
link text
+``` + -- cgit v1.2.3