aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Leung <bkleung89@gmail.com>2018-10-22 23:36:44 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-10-22 23:36:44 -0700
commit7eea5c62ed28a8f2b5dedba18bc8a4c7c1215f3f (patch)
tree0ff2ab06cec219381b0ced52a91eacb75d865cc9
parent19e0fcb68bc7bdb506bc2e07f4d23aaf54f535a3 (diff)
downloadpandoc-7eea5c62ed28a8f2b5dedba18bc8a4c7c1215f3f.tar.gz
LaTeX reader: add support for `nolinkurl` command. (#4992)
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs2
-rw-r--r--test/command/4306.md10
2 files changed, 12 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 26ac781db..010cb3add 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -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))
diff --git a/test/command/4306.md b/test/command/4306.md
new file mode 100644
index 000000000..f1267eb9b
--- /dev/null
+++ b/test/command/4306.md
@@ -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 "."]]
+```