From: Mischa POSLAWSKY Date: Wed, 17 Jun 2020 22:24:42 +0000 (+0200) Subject: word: reduce size of parenthesised form part X-Git-Tag: v1.13~205 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/199fb2b1ee6fcc518ebb2b84115858fc0c4cbd2f word: reduce size of parenthesised form part Syntax for optional elongation as in "rhino(ceros)" or "chimp(anzee)". --- diff --git a/word.plp b/word.plp index 40cc889..12c90b1 100644 --- a/word.plp +++ b/word.plp @@ -40,7 +40,9 @@ sub showimg { my ($id, $name) = @_; my ($imgname) = $name =~ m{^([^/]+)}; $name =~ s/\w{4} [^aoeuiyc\W] [rl]?+ \K (?= [^aoeuiy\W] [rl]? [aoeuiy] \w)/­/gx; - $name =~ s{/(.*)}{ ($1)}g; + ($name, my @morenames) = split m{/}, $name; + $name =~ s{\( ([^/]+) \)}{$1}x; + $name .= " ($_)" for @morenames; my $hidden = $name =~ s/\?$//; $name = "$name" if $name =~ s/\?$//; $name = "
$name
";