3 # polish-help-txt.pl -- polish text format help (e.g. tg-tag.txt)
4 # Copyright (C) 2015,2017,2020,2021 Kyle J. McKay.
6 # License GPLv2 or, at your option, any later version.
16 while (length($s) > $w && $s =~ /^(.{1,$w})(?<=\w)\b[ \t]+(.+)$/s) {
20 $ans .= $s if $s !~ /^\s*$/;
27 $l =~ /^tg / and return $l;
33 # From the Perl camel book "Fluent Perl" section (slightly modified)
34 s/(.*?)(\t+)/$1 . ' ' x (length($2) * 8 - length($1) % 8)/eg;
36 s
'^``(.*)``$'wrap
(78, 4, $1)'e;
37 s'^(\s
*):`(`.+?
`)`: '"$1$2 "'e
;
38 s
'^(\s*):`(.+?)`_: '"$1\"$2\" "'e;
39 s'^(\s
*):(\w
+?
)_?
: '"$1\"$2\""'e
;
40 s
'`([^`]+?)`_'"\"".maybe_uc
($1)."\""'ge;
41 s'`(`[^`]+?`)`'"$1"'ge;
42 s'"(`[^`]+?`)"'"$1"'ge;
43 s' ([A-Za-z]+?)_(?![A-Za-z])'" \"".maybe_uc($1)."\""'ge;