text2html
Rudimentary HTMLising of text.
This filter simply inserts paragraph and line break HTML tags
as it sees fit.
Also see the html2text filter.
Example
[filter text2html]
Some text
Some more text
yet more text
[/filter]
|
Results in:
|
Some text<p>Some more text<br>yet more text<br>
|
Source code
sub {
my $val = shift;
$val =~ s!\r?\n\r?\n!<p>!g;
$val =~ s!\r\r!<p>!g;
$val =~ s!\r?\n!<br$Vend::Xtrailer>!g;
$val =~ s!\r!<br$Vend::Xtrailer>!g;
return $val;
}
|
Donations
If you have a UserTag or Filter that you would like to share with the
Interchange community then please submit it.
We realise that it's extremely rare for people to donate code to Interchange,
but there's no harm in asking.