From 7eea5c62ed28a8f2b5dedba18bc8a4c7c1215f3f Mon Sep 17 00:00:00 2001 From: Brian Leung Date: Mon, 22 Oct 2018 23:36:44 -0700 Subject: [PATCH] LaTeX reader: add support for `nolinkurl` command. (#4992) --- src/Text/Pandoc/Readers/LaTeX.hs | 2 ++ test/command/4306.md | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 test/command/4306.md diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 26ac781dbd80..010cb3add79f 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 000000000000..f1267eb9bccd --- /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 "."]] +```