Skip to content

Commit

Permalink
guard revertScript from inner Tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
dginev committed Feb 7, 2024
1 parent 893f0ce commit 328a7df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/LaTeXML/Package/TeX.pool.ltxml
Original file line number Diff line number Diff line change
Expand Up @@ -4455,8 +4455,9 @@ sub revertScript {
$l++; shift(@t); }
while (@t && $l) {
my $t = shift(@t);
if ($t->defined_as(T_BEGIN)) { $l++; }
elsif ($t->defined_as(T_END)) { $l--; } }
if (ref $t eq 'LaTeXML::Core::Token') { # jump over pre-wrapped Tokens, see arXiv:2210.11051
if ($t->defined_as(T_BEGIN)) { $l++; }
elsif ($t->defined_as(T_END)) { $l--; } } }
return (@tokens && !@t ? @tokens : (T_BEGIN, @tokens, T_END)); }

# Compute the 'advance' of this script.
Expand Down

0 comments on commit 328a7df

Please sign in to comment.