aboutsummaryrefslogtreecommitdiff
path: root/class/class.w.art.php
diff options
context:
space:
mode:
Diffstat (limited to 'class/class.w.art.php')
-rw-r--r--class/class.w.art.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/class/class.w.art.php b/class/class.w.art.php
index 12ff1e3..4c88987 100644
--- a/class/class.w.art.php
+++ b/class/class.w.art.php
@@ -1,6 +1,6 @@
<?php
-use Michelf\Markdown;
+use Michelf\MarkdownExtra;
class Art
@@ -225,7 +225,15 @@ class Art
public function html(App $app)
{
- $html = Markdown::defaultTransform($this->html);
+
+ $html = str_replace('%TITLE%', $this->titre(), $this->html);
+ $html = str_replace('%DESCRIPTION%', $this->intro(), $html);
+
+ $parser = new MarkdownExtra;
+ $parser->header_id_func = function ($header) {
+ return preg_replace('/[^a-z0-9]/', '', strtolower($header));
+ };
+ $html = $parser->transform($html);
$html = str_replace('href="=', 'href="?id=', $html);
foreach ($this->lien('array') as $id) {
@@ -241,9 +249,6 @@ class Art
}
-
- $html = str_replace('%TITLE%', $this->titre(), $html);
- $html = str_replace('%DESCRIPTION%', $this->intro(), $html);
$html = str_replace('href="../media/', ' class="file" target="_blank" href="../media/', $html);
$html = str_replace('href="http', ' class="external" target="_blank" href="http', $html);
$html = str_replace('<img src="/', '<img src="../media/', $html);