for ( $i = 0; $i < @{ $block }; $i++ ) {
push @lines, " * $block->[ $i ]->{ 'TEXT' }";
}
-
- push @lines, "";
}
elsif ( $block->[ 0 ]->{ 'FORMAT' } eq "enumerate" )
{
for ( $i = 0; $i < @{ $block }; $i++ ) {
push @lines, " " . ( $i + 1 ) . ". $block->[ $i ]->{ 'TEXT' }";
}
-
- push @lines, "";
}
elsif ( $block->[ 0 ]->{ 'FORMAT' } eq "paragraph" )
{
{
$line = $triple->{ 'TEXT' };
+ $line =~ s/!(\w)/$1/g;
$line =~ s/^\s*//;
$line =~ s/\s*$//;
$line =~ s/\s+/ /g;
$line =~ tr/`//d;
- $line =~ s/\[([^\]]+?)\]/$1/g;
- $line =~ s/\*([^\*]+?)\*/&text_bold($1)/ge;
- $line =~ s/_([^_]+?)_/&text_underline($1)/ge;
+ $line =~ s/\[([^\]]+?)\]/&text_underline($1)/ge;
+ $line =~ s/\*(\w+)\*/&text_bold($1)/ge if $line =~ /(^| )\*\w+\*( |$)/;
+ $line =~ s/_(\w+)_/&text_underline($1)/ge if $line =~ /(^| )_\w+_( |$)/;
- push @lines, $_ foreach &Maasha::Common::wrap_line( $line, 80 );
+ push @lines, $_ foreach Maasha::Common::wrap_line( $line, 80 );
}
}
elsif ( $block->[ 0 ]->{ 'FORMAT' } eq "whitespace" )
my ( $fh, @lines, $i, $c, $section, $paragraph, @block, @output );
- $fh = &Maasha::Common::read_open( $file );
+ $fh = Maasha::Common::read_open( $file );
@lines = <$fh>;
my ( $txt,
) = @_;
- return colored ( $txt, "magenta" );
+ return colored ( $txt, "bold" );
}