LaTeX reader: add support for nolinkurl command. (#4992)

This commit is contained in:
Brian Leung 2018-10-22 23:36:44 -07:00 committed by John MacFarlane
parent 19e0fcb68b
commit 7eea5c62ed
2 changed files with 12 additions and 0 deletions

View file

@ -988,6 +988,8 @@ inlineCommands = M.union inlineLanguageCommands $ M.fromList
, ("Verb", doverb)
, ("url", ((unescapeURL . T.unpack . untokenize) <$> bracedUrl) >>= \url ->
pure (link url "" (str url)))
, ("nolinkurl", ((unescapeURL . T.unpack . untokenize) <$> bracedUrl) >>= \url ->
pure (code url))
, ("href", (unescapeURL . toksToString <$>
bracedUrl <* optional sp) >>= \url ->
tok >>= \lab -> pure (link url "" lab))

10
test/command/4306.md Normal file
View file

@ -0,0 +1,10 @@
```
pandoc -f latex -t native
\documentclass{article}
\usepackage{hyperref}
\begin{document}
The file id is \nolinkurl{ESP_123_5235}.
\end{document}
^D
[Para [Str "The",Space,Str "file",Space,Str "id",Space,Str "is",Space,Code ("",[],[]) "ESP_123_5235",Str "."]]
```