line
Discard all but the first line of the body text.
The first line ends with one of the following:
- A line feed ("\n").
- A carriage returm, line feed sequence ("\r\n").
- The end of the text.
Anything after this is discarded.
This filter does not treat an ASCII NUL ("\0") character as
a line ending,
nor does it recognise a carriage return ("\r") that is not
immediately followed with a line feed ("\n").
If you want to strip everything after an ASCII NUL or ASCII CR,
then use the "oneline" filter instead.
Example
[filter line]Line 1
Line 2
Line 3
[/filter]
|
Results in:
Source code
sub {
my $val = shift;
$val =~ s/^(.*?)\r?\n.*$/$1/s;
return $val;
}
|