forked from lonalore/simplemde
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbb_markdown.php
More file actions
48 lines (38 loc) · 718 Bytes
/
bb_markdown.php
File metadata and controls
48 lines (38 loc) · 718 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* @file
* Contains class for [markdown] bbcode.
*/
if(!defined('e107_INIT'))
{
exit;
}
/**
* Class bb_markdown.
*/
class bb_markdown extends e_bb_base
{
/**
* Called prior to save. Re-assemble the bbcode.
*/
function toDB($text, $parm)
{
return '[markdown]' . $text . '[/markdown]';
}
/**
* Translate Markdown text into the appropriate HTML.
*/
function toHTML($text, $parm)
{
e107_require_once(e_PLUGIN . 'simplemde/includes/parsedown.php');
$Parsedown = new e107Parsedown();
return $Parsedown->text($text);
}
/**
* Prepare contents for editor.
*/
function toWYSIWYG($text, $parm)
{
// return str_replace(array('[markdown]', '[/markdown]'), '', $text);
}
}