Index: lib/TWiki/Render.pm =================================================================== --- lib/TWiki/Render.pm (revision 3765) +++ lib/TWiki/Render.pm (working copy) @@ -1149,6 +1149,7 @@ * showvar - shows !%VAR% names if not expanded * expandvar - expands !%VARS% * nohead - strips ---+ headings at the top of the text + * maxlen=n - limits output to n characters =cut @@ -1191,6 +1192,12 @@ $text =~ s/^\s+//; # remove leading whitespace $text =~ s/\s+$//; # remove trailing whitespace + if( $opts =~ /maxlen=([0-9]+)/ ) { + my $maxlen = $1; + $text =~ s/[\n]+/ /g; # remove returns to allow insertion in table + $text = substr( $text, 0, $maxlen); + } + return $text; } Index: lib/TWiki/Search.pm =================================================================== --- lib/TWiki/Search.pm (revision 3765) +++ lib/TWiki/Search.pm (working copy) @@ -864,7 +877,7 @@ $out =~ s/%TEXTHEAD%/$text/go; } elsif( $theFormat ) { - $out =~ s/\$summary\(([^\)]*)\)/$this->renderer()->makeTopicSummary( $text, $topic, $web, $1 )/geos; + $out =~ s/\$summary\(([^\)]*)\)/$this->renderer()->makeTopicSummary( $text, $topic, $web, "maxlen=$1" )/geos; $out =~ s/\$summary/$this->renderer()->makeTopicSummary( $text, $topic, $web )/geos; $out =~ s/\$parent\(([^\)]*)\)/_breakName( _getMetaParent( $meta ), $1 )/geos; $out =~ s/\$parent/_getMetaParent( $meta )/geos;