\cprotect amendment

\cprotect'ed insets do not need forced local font switch; in fact files
with this break in compilation. E.g. a caption with an URL containing
the char '#' and caption text set to a secondary language.
This commit is contained in:
Juergen Spitzmueller 2024-06-22 13:38:47 +02:00
parent 45dce93af7
commit 8659924abd

View File

@ -1001,7 +1001,10 @@ void TeXOnePar(Buffer const & buf,
&& (prev_language->rightToLeft() != par_language->rightToLeft()));
bool const localswitch =
(runparams_in.find_effective()
|| text.inset().forceLocalFontSwitch()
// \cprotect'ed insets do not need, and actually
// break with, local switches
|| (text.inset().forceLocalFontSwitch()
&& !text.inset().needsCProtection(maintext, runparams.moving_arg))
|| (using_begin_end && text.inset().forcePlainLayout())
|| in_polyglossia_rtl_env)
&& !text.inset().forceParDirectionSwitch();