From: Pádraig Brady
Date: Thu, 15 Jan 2026 21:36:09 +0000 (+0000) Subject: doc: help2man: support alternate format OSC hyperlinks X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0705a83f6c6667f9b615e18c20ac24384f6f1a9;p=thirdparty%2Fcoreutils.git doc: help2man: support alternate format OSC hyperlinks * man/help2man: The BEL terminator format was already supported. Add support for ESC + backslash terminator. Also split out and document the regular expression. --- diff --git a/man/help2man b/man/help2man index 35ff3803eb..75ef131077 100755 --- a/man/help2man +++ b/man/help2man @@ -815,11 +815,16 @@ sub get_option_value # Convert OSC 8 hyperlinks to markers placed after leading dashes # This preserves help2man's option detection (which looks for /^ +[-+]/) - $value =~ s/\x1b\]8;;([^\x07]*)\x07(--?)(.*?)\x1b\]8;;\x07/{ + # Support both BEL (\x07) and ST (\x1b\) terminators + $value =~ s/ + \x1b\]8;;([^\x07\x1b]*)(?:\x07|\x1b\\) # opening OSC 8 with URL + (--?)(.*?) # dashes and link text + \x1b\]8;;(?:\x07|\x1b\\) # closing OSC 8 + /{ my $idx = scalar @hyperlink_urls; push @hyperlink_urls, $1; "$2\x01$idx\x02$3\x03"; - }/gse; + }/gsex; $value; }