- or download this
* A line like
this one.
- or download this
sub format {
my $self = shift;
my $source = shift;
...
return cleanup_html($html);
}
- or download this
sub classify_line { # return (indent, type, modified_line, info)
local $_ = shift;
...
s/^(\s*)// && return (length($1), $PLAIN, $_, undef);
die "classify_line:\n\t" . $_ . "\n";
}
- or download this
sub maybe_new_scope {
# if the "enter new scope" rule for the current scope fires then
...
return 0;
}
- or download this
my %rulesets = (
# The "null" ruleset exists to force us into an initial scope
0 => {
...
sub { emit("</pre>\n") },
}
);
- or download this
# The HTML that we've generated may need to be cleaned up. By deferrin
+g
# cleanup, the algorithms above can be simpler.
#
...
return $html;
}