From fc4212dd672962bc48ad0cc86245494b6516a742 Mon Sep 17 00:00:00 2001 From: Omikhleia Date: Sun, 31 Jul 2022 12:44:57 +0200 Subject: [PATCH] fix(packages): Correct URL formatting when backend is not libpdftex When pdf is supported, `\href[src=uri]{text}` output the text in current font and `\href{uri}` delegates the content to `\url`, with additional breakpoints and possibly a different font. The formatting behavior shall be the same when pdf is not supported. --- packages/url/init.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/url/init.lua b/packages/url/init.lua index 5010f3838..b40387d92 100644 --- a/packages/url/init.lua +++ b/packages/url/init.lua @@ -48,7 +48,15 @@ end function package:registerCommands () self:registerCommand("href", function (options, content) - if not pdf then return SILE.process(content) end + if not pdf then + if options.src then + SILE.process(content) + else + SILE.call("url", { language = options.language }, content) + end + return -- DONE. + end + if options.src then SILE.call("pdf:link", { dest = options.src, external = true, borderwidth = options.borderwidth,