fixed #37 as a temporary solution until we have a markdown converter

master
BodgeMaster 2021-09-02 05:09:32 +02:00
parent 1da694b492
commit 2c2db7de0a
1 changed files with 4 additions and 0 deletions

View File

@ -13,6 +13,10 @@ foreach($statement->fetchAll() as $ROW) {
$post_time = htmlspecialchars($ROW['post_time']);
$post_content = htmlspecialchars($ROW['content']);
// add line breaks to post content, to be replaced with proper makrdown support in the future (see #44)
$newlines = array("\r\n", "\n\r", "\r", "\n") // two-character newlines first to prevent placing two line breaks instead of one
str_replace($newlines, "<br />", $post_content);
echo "<section>
<h1>$post_title</h1>
<article>