diff --git a/lib/LaTeXML/Package/hyperref.sty.ltxml b/lib/LaTeXML/Package/hyperref.sty.ltxml
index 820339cec..422d9b8f0 100644
--- a/lib/LaTeXML/Package/hyperref.sty.ltxml
+++ b/lib/LaTeXML/Package/hyperref.sty.ltxml
@@ -186,7 +186,9 @@ DefMacro('\url', '\begingroup\lx@hyper@url\url', locked => 1);
DefConstructor('\lx@hyper@url@ Undigested {}{} Semiverbatim {}',
"?#isMath(#5)" # Allow this to work in Math!
. " (#5)",
- 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');
@@ -205,7 +207,9 @@ DefMacro('\hyperref', '\@ifnextchar[\hyperref@@ii\hyperref@@iv');
# 2 argument form
DefConstructor('\hyperref@@ii OptionalSemiverbatim {}',
"#2",
- 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',
"#4",