package
EBook::Ishmael::EBook::XHTML;
use
5.016;
our
$VERSION
=
'1.06'
;
use
strict;
use
warnings;
sub
heuristic {
my
$class
=
shift
;
my
$file
=
shift
;
my
$fh
=
shift
;
return
1
if
$file
=~ /\.xhtml?$/;
return
0
unless
-T
$fh
;
read
$fh
,
my
(
$head
), 1024;
return
0
unless
$head
=~ /<[^<>]+xmlns\s*=\s*
"\Q$XHTML_NS\E"
[^<>]*>/;
return
$head
=~ /<\s
*html
[^<>]+>/;
}
1;