Skip to content

Commit

Permalink
scoped \href arguments to avoid leaking color
Browse files Browse the repository at this point in the history
  • Loading branch information
dginev committed Oct 24, 2024
1 parent 9f07a49 commit 06ccb36
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/LaTeXML/Package/hyperref.sty.ltxml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ DefMacro('\url', '\begingroup\lx@hyper@url\url', locked => 1);
DefConstructor('\lx@hyper@url@ Undigested {}{} Semiverbatim {}',
"?#isMath(<ltx:XMWrap class='#class' href='#href'>#5</ltx:XMWrap>)" # Allow this to work in Math!
. " (<ltx:ref href='#href' class='#class'>#5</ltx:ref>)",
properties => sub { (href => ComposeURL(LookupValue('BASE_URL'), $_[4]),
beforeDigest => \&LaTeXML::Core::Stomach::bgroup,
afterDigest => \&LaTeXML::Core::Stomach::egroup,
properties => sub { (href => ComposeURL(LookupValue('BASE_URL'), $_[4]),
class => sub { my $c = ToString($_[1]); $c =~ s/^\\//; 'ltx_' . $c; }); },
sizer => '#5',
reversion => '#1#2#4#3');
Expand All @@ -205,7 +207,9 @@ DefMacro('\hyperref', '\@ifnextchar[\hyperref@@ii\hyperref@@iv');
# 2 argument form
DefConstructor('\hyperref@@ii OptionalSemiverbatim {}',
"<ltx:ref labelref='#label'>#2</ltx:ref>",
properties => sub { (label => CleanLabel($_[1])); });
beforeDigest => \&LaTeXML::Core::Stomach::bgroup,
afterDigest => \&LaTeXML::Core::Stomach::egroup,
properties => sub { (label => CleanLabel($_[1])); });
# 4 argument form
DefConstructor('\hyperref@@iv Semiverbatim Semiverbatim Semiverbatim Semiverbatim',
"<ltx:ref href='#href'>#4</ltx:ref>",
Expand Down

0 comments on commit 06ccb36

Please sign in to comment.