diff options
author | Karl Berry <karl@freefriends.org> | 2021-01-10 21:49:38 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-01-10 21:49:38 +0000 |
commit | a4410f9e5a2763c12cda6a12dd8241265fd0d169 (patch) | |
tree | 0ac81c2a979e76affdf0bb702cc166c83be06557 /Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx | |
parent | 1a73c52220cf76a3e48179a1f63bc50f760ff759 (diff) |
l3 (9jan21)
git-svn-id: svn://tug.org/texlive/trunk@57375 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx index 0166cc20f6a..0241a11e60c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx @@ -2,7 +2,7 @@ % %% File: l3text-purify.dtx % -% Copyright (C) 2020 The LaTeX3 Project +% Copyright (C) 2020,2021 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-12-07} +% \date{Released 2021-01-09} % % \maketitle % @@ -94,7 +94,8 @@ % \begin{macro}[EXP]{\@@_purify_math_cmd:Nn} % \begin{macro}[EXP]{\@@_purify_replace:N} % \begin{macro}[EXP]{\@@_purify_replace:n} -% \begin{macro}[EXP]{\@@_purify_expand:N, \@@_purify_protect:N} +% \begin{macro}[EXP]{\@@_purify_expand:N, \@@_purify_protect:N, \@@_purify_encoding:N} +% \begin{macro}[EXP]{\@@_purify_encoding_escape:NN} % As in the other parts of the module, we start off with a standard % \enquote{action} loop, with expansion applied up-front. % \begin{macrocode} @@ -288,15 +289,31 @@ { \str_if_eq:nnTF {#1} { \protect } { \@@_purify_protect:N } + { \@@_purify_encoding:N #1 } + } +\cs_new:Npn \@@_purify_protect:N #1 + { + \@@_if_recursion_tail_stop_do:Nn #1 { \@@_purify_end:w } + \@@_purify_loop:w + } +% \end{macrocode} +% Handle encoding commands, as detailed for expansion. +% \begin{macrocode} +\cs_new:Npn \@@_purify_encoding:N #1 + { + \bool_lazy_or:nnTF + { \cs_if_eq_p:NN #1 \@current@cmd } + { \cs_if_eq_p:NN #1 \@changed@cmd } + { \@@_purify_encoding_escape:NN } { \@@_if_expandable:NTF #1 { \exp_after:wN \@@_purify_loop:w #1 } { \@@_purify_loop:w } } } -\cs_new:Npn \@@_purify_protect:N #1 +\cs_new:Npn \@@_purify_encoding_escape:NN #1#2 { - \@@_if_recursion_tail_stop_do:Nn #1 { \@@_purify_end:w } + \@@_purify_store:n {#1} \@@_purify_loop:w } % \end{macrocode} @@ -323,6 +340,7 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % \begin{macro} % { |