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

You are not logged in

Powered by Interchange version 5.7.0

options2line

Replaces commas in the body text with a newline ("\n").  It also takes care of removing any leading and trailing whitespace from all lines.

Also see the line2options filter.

Example

[filter]Kevin,Walsh[/filter]

Results in:

Kevin
Walsh

Source code

sub {
    my ($value, $tag, $delim) = @_;
    return $value unless length $value;
    $value =~ s/\s+$//;
    $value =~ s/^\s+//;
    my @opts = split /\s*,\s*/, $value;
    for(@opts) {
        s/,/,/g;
    }
    $value = return join "\n", @opts;
    return $value;
}

Category:  Filters
Last modified by: Kevin Walsh
Modification date: Monday 26 February 2007 at 11:52 AM (EST)
Home  |  Legal nonsense  |  Privacy policy  |  Contact us