-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarkupsPlugin.class.php
More file actions
35 lines (28 loc) · 934 Bytes
/
MarkupsPlugin.class.php
File metadata and controls
35 lines (28 loc) · 934 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
<?php
/**
* MarkupsPlugin.class.php
*
* Integrates the following markups:
*
* - Markdown
* - Textile
*
* @author Jan-Hendrik Willms <tleilax+studip@gmail.com>
* @version 1.0.1
*/
class MarkupsPlugin extends StudIPPlugin implements SystemPlugin {
public function __construct() {
parent::__construct();
StudipFormat::addStudipMarkup('markdown', '\[markdown\]', '\[\/markdown\]', 'MarkupsPlugin::Markdown');
StudipFormat::addStudipMarkup('textile', '\[textile\]', '\[\/textile\]', 'MarkupsPlugin::Textile');
}
public static function Markdown($markup, $matches, $contents) {
require 'vendor/markdown/markdown.php';
return Markdown($contents);
}
public static function Textile($markup, $matches, $contents) {
require 'vendor/classTextile.php';
$textile = new Textile;
return $textile->TextileThis($contents);
}
}