diff options
| author | John MacFarlane <[email protected]> | 2023-06-30 09:04:18 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2023-06-30 09:05:04 -0700 |
| commit | 284eb378e88c5dc18a1eb28b058b415966db78be (patch) | |
| tree | d6f34326e38a544f5964232ed983b5c33a20e117 | |
| parent | 34075d5d0cffd0d43ef9face69db8b76e5bd9e5b (diff) | |
Typst writer: improve handling of autolinks.
Closes #8931.
| -rw-r--r-- | src/Text/Pandoc/Writers/Typst.hs | 2 | ||||
| -rw-r--r-- | test/writer.typst | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Typst.hs b/src/Text/Pandoc/Writers/Typst.hs index 906d4939d..587a5e777 100644 --- a/src/Text/Pandoc/Writers/Typst.hs +++ b/src/Text/Pandoc/Writers/Typst.hs @@ -268,7 +268,7 @@ inlineToTypst inline = Just ('#', ident) -> "<" <> literal ident <> ">" _ -> doubleQuoted src return $ "#link" <> parens dest <> - if render Nothing contents == src + if inlines == [Str src] then mempty else nowrap $ brackets contents Image (_,_,kvs) _inlines (src,_tit) -> do diff --git a/test/writer.typst b/test/writer.typst index 77deb5e24..14658c489 100644 --- a/test/writer.typst +++ b/test/writer.typst @@ -737,8 +737,7 @@ Here’s an #link("/script?foo=1&bar=2")[inline link in pointy braces]. == Autolinks <autolinks> -With an ampersand: -#link("http://example.com/?foo=1&bar=2")[http://example.com/?foo\=1&bar\=2] +With an ampersand: #link("http://example.com/?foo=1&bar=2") - In a list? - #link("http://example.com/") |
