added parsedown function to recipe.php

This commit is contained in:
Tim Krehan 2018-10-24 18:24:05 +02:00
parent 6ee9372ca4
commit e2deee8fc8

View file

@ -2,6 +2,7 @@
<script src="/bin/recipe.js" charset="utf-8"></script>
<?php
include $_SESSION["docroot"].'/php/classes.recipe.php';
include $_SESSION["docroot"].'/php/classes.parsedown.php';
$book = new cookbook;
$book->getRecipe($_GET["number"]);
$recipe = $book->sites[0];
@ -17,9 +18,13 @@
}
echo "</div>";
echo "<h2>Zubereitung</h2>";
foreach(explode("\r\n", $recipe->Beschreibung) as $paragraph){
echo "<p>$paragraph</p>";
}
$parsedown = new Parsedown;
// var_dump($recipe->Beschreibung);
echo $parsedown->text($recipe->Beschreibung);
// foreach(explode("\r\n", $recipe->Beschreibung) as $paragraph){
// echo "<p>$paragraph</p>";
// }
?>
<div id="editingMenu"></div>
<div id="editingMenuOpen">