App-DocKnot
view release on metacpan or search on metacpan
lib/App/DocKnot/Spin/Text.pm view on Meta::CPAN
# Whether a line is an RFC 2822 header.
#
# $line - Line to classify
#
# Returns: True if so, false otherwise
sub _is_header {
my ($line) = @_;
return if $line =~ m{ \A [\w-]+: \s+ \N }xms;
}
# Whether a paragraph is a heading. This is all about heuristics and guesses,
# and there are a number of other things we could confuse for headings, so we
# have to be careful.
#
# If it's a single line and outdented from the baseline, it's probably a
# heading.
#
# If it's at the baseline, check to see if it looks like a heading and either
# it's in all caps or there is a rule underneath it. If we haven't seen a
# baseline, be more accepting about headers.
#
( run in 0.712 second using v1.01-cache-2.11-cpan-702932259ff )