[latex3-commits] [git/LaTeX3-latex3-latex3] main: Protect babel shorthands from expansion (e299538ff)

Joseph Wright joseph.wright at morningstar2.co.uk
Sat Dec 17 11:54:07 CET 2022


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/e299538ffa4a8fcfcd455bfdb46ab53c50ece818

>---------------------------------------------------------------

commit e299538ffa4a8fcfcd455bfdb46ab53c50ece818
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sat Dec 17 10:51:04 2022 +0000

    Protect babel shorthands from expansion


>---------------------------------------------------------------

e299538ffa4a8fcfcd455bfdb46ab53c50ece818
 l3kernel/CHANGELOG.md | 3 +++
 l3kernel/l3text.dtx   | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 986b06131..0a24862ea 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -12,6 +12,9 @@ this project uses date-based 'snapshot' version identifiers.
 - `\codepoint_generate:n` and `\codepoint_str_generate:n`
 - `\str_casefold:n`
 
+### Changed
+- Protect `babel` shorthands from expansion
+
 ### Fixed
 - Appearance of `\DescribeOption` (issue
   [\#1111](https://github.com/latex3/latex3/issues/1111))
diff --git a/l3kernel/l3text.dtx b/l3kernel/l3text.dtx
index 5f94ac88f..3b366c97c 100644
--- a/l3kernel/l3text.dtx
+++ b/l3kernel/l3text.dtx
@@ -827,6 +827,7 @@
   {
     \exp_not:n { \begin \cite \end \label \ref }
     \exp_not:c { cite ~ }
+    \exp_not:n { \babelshorthand }
   }
 %    \end{macrocode}
 % \end{variable}
@@ -1178,7 +1179,8 @@
 %   from handling of legacy input encodings: they need to end up in a
 %   representation we can deal with in further processing. The tests for
 %   explicit parts of the \LaTeXe{} UTF-8 mechanism cover the case of
-%   bookmarks, where definitions change and are no longer protected.
+%   bookmarks, where definitions change and are no longer protected. The
+%   same is true for \pkg{babel} shorthands.
 %    \begin{macrocode}
 \cs_new:Npn \@@_expand_explicit:N #1
   {
@@ -1195,6 +1197,7 @@
                 { \tl_if_head_eq_meaning_p:oN {#1} \UTFviii at two@octets }
                 { \tl_if_head_eq_meaning_p:oN {#1} \UTFviii at three@octets }
                 { \tl_if_head_eq_meaning_p:oN {#1} \UTFviii at four@octets }
+                { \tl_if_head_eq_meaning_p:oN {#1} \active at prefix }
               }
           }
           { \exp_after:wN \@@_expand_loop:w #1 }





More information about the latex3-commits mailing list.