Skip to content

Commit

Permalink
fix(packages): Correct URL formatting when backend is not libpdftex
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Omikhleia authored and Didier Willis committed Jul 31, 2022
1 parent 7925d45 commit fc4212d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/url/init.lua
Expand Up @@ -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,
Expand Down

0 comments on commit fc4212d

Please sign in to comment.