perl: optional line breaks in long code examples
[sheet.git] / perl.plp
index 716a1ebfcc51a40ce8554f5da32d028bd4449a9e..89b906e82b503298e009f058e67984758d9313ed 100644 (file)
--- a/perl.plp
+++ b/perl.plp
@@ -132,7 +132,9 @@ sub featattrs ($attr) {
        $title = $title ? sprintf ' <em class="ex">(%s)</em>', $title : '';
 
        if (my $eg = $attr->{eg}) {
-               my $pre = sprintf ' <small>{<code>%s</code>}</small>', Entity($eg);
+               my $pre = Entity($eg);
+               $pre =~ s<\N{ZERO WIDTH SPACE}>{</code><wbr/><code>}g;
+               $pre = " <small>{<code>$pre</code>}</small>";
                $title = $pre . $title;
        }
        return $title;