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

Bruno Le Floch blflatex at gmail.com
Sun Apr 25 11:49:11 CEST 2021


Repository : https://github.com/latex3/latex3
On branch  : gh479
Link       : https://github.com/latex3/latex3/commit/75c63fda64f53e139da8fc86c91f37e530f8b0f1

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

commit 75c63fda64f53e139da8fc86c91f37e530f8b0f1
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.


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

75c63fda64f53e139da8fc86c91f37e530f8b0f1
 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.