[latex3-commits] [git/LaTeX3-latex3-latex3] main: Avoid hyphenation in the first run of underscores in l3doc's \cs (fixes #479) (51c73edc8)

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Apr 25 12:01:47 CEST 2021


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

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

commit 51c73edc829ace6a98797b7155e18b4ee4120afa
Author: Bruno Le Floch <blflatex at gmail.com>
Date:   Sun Apr 25 11:49:11 2021 +0200

    Avoid hyphenation in the first run of underscores in l3doc's \cs (fixes #479)
    
    wspr had already done essentially all the work fixing this, but the regex
    wasn't quite right: it didn't correctly omit hyphenation after a backslash
    when it was followed by two (or more) underscores.


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

51c73edc829ace6a98797b7155e18b4ee4120afa
 l3kernel/l3doc.dtx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/l3kernel/l3doc.dtx b/l3kernel/l3doc.dtx
index 233b89aad..255bddaba 100644
--- a/l3kernel/l3doc.dtx
+++ b/l3kernel/l3doc.dtx
@@ -1996,8 +1996,8 @@ and all files in that bundle must be distributed together.
             \bool_if:NT \g_@@_cs_break_bool
               {
                 \regex_replace_all:nnN
-                  {([^\\])_([^\_])}
-                  {\1\c{BreakableUnderscore}\2}
+                  { ([^\\\_]\_*) \_ ([^\_]) }
+                  { \1 \c{BreakableUnderscore} \2 }
                   \l_@@_cmd_tl
               }
           }





More information about the latex3-commits mailing list.