LaTeX, fix \sphinxhref + \includegraphics problem with platex

Upstream issue: https://github.com/latex3/latex2e/issues/286

Fixes #7197
This commit is contained in:
jfbu 2020-02-23 08:53:37 +01:00
parent 5f1c0b5430
commit 6eac7901c9
2 changed files with 4 additions and 1 deletions

View File

@ -16,6 +16,8 @@ Features added
Bugs fixed
----------
* #7197: LaTeX: platex cause error to build image directive with target url
Testing
--------

View File

@ -1407,7 +1407,8 @@
% \sphinxcode). Sphinx uses \#, \%, \& ... always inside \sphinxhref.
\protected\def\sphinxhref#1#2{{%
\sphinxunactivateextrasandspace % never do \scantokens with active space!
\endlinechar\m@ne\everyeof{{#2}}% keep catcode regime for #2
% for the \endlinechar business, https://github.com/latex3/latex2e/issues/286
\endlinechar\m@ne\everyeof{{\endlinechar13 #2}}% keep catcode regime for #2
\scantokens{\href{#1}}% normalise it for #1 during \href expansion
}}
% Same for \url. And also \nolinkurl for coherence.