summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES3
-rw-r--r--sphinx/texinputs/sphinxlatexadmonitions.sty4
-rw-r--r--sphinx/texinputs/sphinxlatexliterals.sty4
-rw-r--r--sphinx/texinputs/sphinxlatexshadowbox.sty4
4 files changed, 12 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index facdbb089..2c38017f0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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.
diff --git a/sphinx/texinputs/sphinxlatexadmonitions.sty b/sphinx/texinputs/sphinxlatexadmonitions.sty
index 1e418c8c2..b261ad7f6 100644
--- a/sphinx/texinputs/sphinxlatexadmonitions.sty
+++ b/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:
%
@@ -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
diff --git a/sphinx/texinputs/sphinxlatexliterals.sty b/sphinx/texinputs/sphinxlatexliterals.sty
index 3aa08cffa..aa907333f 100644
--- a/sphinx/texinputs/sphinxlatexliterals.sty
+++ b/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:
%
@@ -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
diff --git a/sphinx/texinputs/sphinxlatexshadowbox.sty b/sphinx/texinputs/sphinxlatexshadowbox.sty
index 12d3cec09..4a013ef65 100644
--- a/sphinx/texinputs/sphinxlatexshadowbox.sty
+++ b/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:
%
@@ -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