aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-11-07 21:08:20 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2021-11-07 21:08:20 -0800
commitcc46667953b609d87bbf5611f50843871b304a0c (patch)
treeedfc1a3ccb237d6dd5cfa85f3ae68814bcfce8f3
parent881b45209e8fd70079e409d05fa7402741501940 (diff)
downloadpandoc-cc46667953b609d87bbf5611f50843871b304a0c.tar.gz
LaTeX reader: add 'uri' class when parsing `\url`.
Closes #7672.
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs4
-rw-r--r--test/command/3681.md2
-rw-r--r--test/command/4832.md4
-rw-r--r--test/latex-reader.native6
4 files changed, 8 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 15148debb..25acc0f7e 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -390,8 +390,8 @@ inlineCommands = M.unions
unescapeURL .
removeDoubleQuotes $ untokenize src)
-- hyperref
- , ("url", (\url -> link url "" (str url)) . unescapeURL . untokenize <$>
- bracedUrl)
+ , ("url", (\url -> linkWith ("",["uri"],[]) url "" (str url))
+ . unescapeURL . untokenize <$> bracedUrl)
, ("nolinkurl", code . unescapeURL . untokenize <$> bracedUrl)
, ("href", do url <- bracedUrl
sp
diff --git a/test/command/3681.md b/test/command/3681.md
index 3e6c71a47..dc6b90860 100644
--- a/test/command/3681.md
+++ b/test/command/3681.md
@@ -45,7 +45,7 @@ Software developers create \cicd pipelines to… Following issue can be resolved
, Note
[ Para
[ Link
- ( "" , [] , [] )
+ ( "" , [ "uri" ] , [] )
[ Str "https://en.wikipedia.org/wiki/CI/CD" ]
( "https://en.wikipedia.org/wiki/CI/CD" , "" )
]
diff --git a/test/command/4832.md b/test/command/4832.md
index 5e9f2ac77..ec636b2b7 100644
--- a/test/command/4832.md
+++ b/test/command/4832.md
@@ -4,7 +4,7 @@
^D
[ Para
[ Link
- ( "" , [] , [] )
+ ( "" , [ "uri" ] , [] )
[ Str "http://example.com/foo%20bar.htm" ]
( "http://example.com/foo%20bar.htm" , "" )
]
@@ -17,7 +17,7 @@
^D
[ Para
[ Link
- ( "" , [] , [] )
+ ( "" , [ "uri" ] , [] )
[ Str "http://example.com/foo{bar}.htm" ]
( "http://example.com/foo{bar}.htm" , "" )
]
diff --git a/test/latex-reader.native b/test/latex-reader.native
index 2be447c0d..32ee86899 100644
--- a/test/latex-reader.native
+++ b/test/latex-reader.native
@@ -1868,7 +1868,7 @@ Pandoc
, Str "ampersand:"
, Space
, Link
- ( "" , [] , [] )
+ ( "" , [ "uri" ] , [] )
[ Str "http://example.com/?foo=1&bar=2" ]
( "http://example.com/?foo=1&bar=2" , "" )
]
@@ -1878,7 +1878,7 @@ Pandoc
]
, [ Para
[ Link
- ( "" , [] , [] )
+ ( "" , [ "uri" ] , [] )
[ Str "http://example.com/" ]
( "http://example.com/" , "" )
]
@@ -1902,7 +1902,7 @@ Pandoc
[ Str "Blockquoted:"
, Space
, Link
- ( "" , [] , [] )
+ ( "" , [ "uri" ] , [] )
[ Str "http://example.com/" ]
( "http://example.com/" , "" )
]