parent
50da88446c
commit
a96c762a10
2 changed files with 18 additions and 3 deletions
|
@ -1090,10 +1090,15 @@ targetURI :: Monad m => ParserT [Char] st m [Char]
|
|||
targetURI = do
|
||||
skipSpaces
|
||||
optional newline
|
||||
contents <- many1 (try (many spaceChar >> newline >>
|
||||
many1 spaceChar >> noneOf " \t\n") <|> noneOf "\n")
|
||||
contents <- trim <$>
|
||||
many1 (satisfy (/='\n')
|
||||
<|> try (newline >> many1 spaceChar >> noneOf " \t\n"))
|
||||
blanklines
|
||||
return $ escapeURI $ trim contents
|
||||
case reverse contents of
|
||||
-- strip backticks
|
||||
'_':'`':xs -> return (dropWhile (=='`') (reverse xs) ++ "_")
|
||||
'_':_ -> return contents
|
||||
_ -> return (escapeURI contents)
|
||||
|
||||
substKey :: PandocMonad m => RSTParser m ()
|
||||
substKey = try $ do
|
||||
|
|
10
test/command/4598.md
Normal file
10
test/command/4598.md
Normal file
|
@ -0,0 +1,10 @@
|
|||
```
|
||||
% pandoc -f rst
|
||||
`x`__
|
||||
|
||||
__ `xy`_
|
||||
|
||||
.. _`xy`: http://xy.org
|
||||
^D
|
||||
<p><a href="http://xy.org">x</a></p>
|
||||
```
|
Loading…
Add table
Reference in a new issue