For more information... RTFM!
NAVIGATION
RECENTLY VIEWED
PAGES THAT LINK HERE
ACCOUNT LOGIN

You are not logged in

Powered by Interchange version 5.7.0

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;
}

Category:  Filters
Last modified by: Kevin Walsh
Modification date: Monday 26 February 2007 at 11:46 AM (EST)

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.

SPONSORS
Cursor Software: Expert Interchange consultancy
Webmaint.net: UK Interchange business hosting
Home  |  Legal nonsense  |  Privacy policy  |  Contact us