1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-12-22 12:50:36 +01:00

Added anchors to FAQ

This commit is contained in:
kkapsner 2022-01-30 11:00:00 +01:00
parent 640bd36b86
commit 863140c1ca

View File

@ -14,7 +14,7 @@
foreach (new DirectoryIterator("./") as $file){ foreach (new DirectoryIterator("./") as $file){
if (!$file->isDot() && !$file->isDir() && $file->getExtension() === "md"){ if (!$file->isDot() && !$file->isDir() && $file->getExtension() === "md"){
$markdown = $parser->parse(file_get_contents($file->getPathname())); $markdown = $parser->parse(file_get_contents($file->getPathname()));
echo $markdown->view("html"); echo preg_replace("/<h2/", "<h2 id=\"" . str_replace(".md", "", $file->getFilename()) . "\"", $markdown->view("html"), 1);
} }
} }
?> ?>