-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
27 lines (23 loc) · 867 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php namespace x\markdown;
function page__content($content) {
$type = $this->type;
if ('Markdown' !== $type && 'text/markdown' !== $type) {
return $content;
}
$content = \strtr(from($content) ?? "", [' />' => '>']);
return "" !== $content ? $content : null;
}
function page__description($description) {
return \fire(__NAMESPACE__ . "\\page__title", [$description], $this);
}
function page__title($title) {
$type = $this->type;
if ('Markdown' !== $type && 'text/markdown' !== $type) {
return $title;
}
$title = \strtr(from($title, false) ?? "", [' />' => '>']);
return "" !== $title ? $title : null;
}
\Hook::set('page.content', __NAMESPACE__ . "\\page__content", 2);
\Hook::set('page.description', __NAMESPACE__ . "\\page__description", 2);
\Hook::set('page.title', __NAMESPACE__ . "\\page__title", 2);