--TEST--
extractTitle: extracts title from # heading in .md or
in .html
--FILE--
file_put_contents("$dir/index.html", "HTML Title
Body
");
echo extractTitle($dir) . "\n";
unlink("$dir/index.html");
// HTML with attributes on h1
file_put_contents("$dir/index.html", 'Styled Title
');
echo extractTitle($dir) . "\n";
unlink("$dir/index.html");
// Markdown without heading
file_put_contents("$dir/index.md", "Just a paragraph, no heading.");
echo (extractTitle($dir) ?? 'null') . "\n";
unlink("$dir/index.md");
rmdir($dir);
?>
--EXPECT--
null
My Great Post
Spaced Title
HTML Title
Styled Title
null