Skip to content

Commit

Permalink
Fix #10633 LaTeX: upstream framed.sty color leak bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbu committed Jul 3, 2022
1 parent 5ffe1e8 commit 2ac802f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Expand Up @@ -38,6 +38,9 @@ Bugs fixed
* #10566: HTML Theme: Fix enable_search_shortcuts does not work
* #8686: LaTeX: Text can fall out of code-block at end of page and leave artifact
on next page
* #10633: LaTeX: user injected ``\color`` commands in topic or admonition boxes may
cause color leaks in PDF due to upstream `framed.sty <https://ctan.org/pkg/framed>`_
bug
* #10579: i18n: UnboundLocalError is raised on translating raw directive
* #9577, #10088: py domain: Fix warning for duplicate Python references when
using ``:any:`` and autodoc.
Expand Down
4 changes: 3 additions & 1 deletion sphinx/texinputs/sphinxlatexadmonitions.sty
@@ -1,7 +1,7 @@
%% NOTICES AND ADMONITIONS
%
% change this info string if making any custom modification
\ProvidesFile{sphinxlatexadmonitions.sty}[2021/01/27 admonitions]
\ProvidesFile{sphinxlatexadmonitions.sty}[2022/07/03 admonitions]

% Provides support for this output mark-up from Sphinx latex writer:
%
Expand Down Expand Up @@ -103,9 +103,11 @@
\let\@listdepth\@mplistdepth \@mplistdepth\z@
\@minipagerestore
\@setminipage }%
\color@begingroup % workaround to an upstream framed.sty bug
}
{%
\par\unskip
\color@endgroup % matches the \color@begingroup
\@minipagefalse
\endMakeFramed
\ifspx@inframed\end{minipage}\fi
Expand Down
4 changes: 3 additions & 1 deletion sphinx/texinputs/sphinxlatexliterals.sty
@@ -1,7 +1,7 @@
%% LITERAL BLOCKS
%
% change this info string if making any custom modification
\ProvidesFile{sphinxlatexliterals.sty}[2022/06/30 code-blocks and parsed literals]
\ProvidesFile{sphinxlatexliterals.sty}[2022/07/03 code-blocks and parsed literals]

% Provides support for this output mark-up from Sphinx latex writer:
%
Expand Down Expand Up @@ -742,11 +742,13 @@
% never reset, and it issues \@minipagefalse repeatedly (from \@setminipage).
% As fancyvrb Verbatim will do \@minipagefalse itself, let's simplify things.
\everypar{}%
\color@begingroup % protect against color leaks (upstream framed.sty bug)
% will fetch its optional arguments if any
\OriginalVerbatim
}
{%
\endOriginalVerbatim
\color@endgroup % matches the \color@begingroup
\ifspx@inframed
\egroup % finish \sphinxVerbatim@ContentsBox vbox
\nobreak % update page totals
Expand Down
4 changes: 3 additions & 1 deletion sphinx/texinputs/sphinxlatexshadowbox.sty
@@ -1,7 +1,7 @@
%% TOPIC AND CONTENTS BOXES
%
% change this info string if making any custom modification
\ProvidesFile{sphinxlatexshadowbox.sty}[2022/06/30 sphinxShadowBox]
\ProvidesFile{sphinxlatexshadowbox.sty}[2022/07/03 sphinxShadowBox]

% Provides support for this output mark-up from Sphinx latex writer:
%
Expand Down Expand Up @@ -138,9 +138,11 @@
\@minipagerestore
\@setminipage
}%
\color@begingroup % workaround upstream framed.sty bug
}%
{% insert the "endminipage" code
\par\unskip
\color@endgroup % matches the \color@begingroup
\@minipagefalse
\endMakeFramed
\ifspx@inframed\end{minipage}\fi
Expand Down

0 comments on commit 2ac802f

Please sign in to comment.