blob: bb2e96f2b3f51eb629bd605dd5e641b7d30ec7df (
plain)
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
|
<?php
/**
* @version $Revision$
* @package liberty
* @subpackage plugins_format
*/
/**
* Initialization
*/
global $gLibertySystem;
/**
* definitions
*/
define( 'PLUGIN_GUID_MARKDOWN', 'markdown' );
$pluginParams = array (
'load_function' => 'markdown_parse_data',
'verify_function' => 'markdown_verify_data',
'auto_activate' => FALSE,
'description' => 'This parser allows you to use plain text, which is then converted to HTML. For the full syntax, please view <a href ="http://daringfireball.net/projects/markdown/syntax">Markdown Syntax</a>',
'edit_label' => 'Markdown',
'edit_field' => PLUGIN_GUID_MARKDOWN,
'plugin_type' => FORMAT_PLUGIN,
'linebreak' => "\r\n"
);
$gLibertySystem->registerPlugin( PLUGIN_GUID_MARKDOWN, $pluginParams );
function markdown_verify_data( &$pParamHash ) {
$pParamHash['content_store']['data'] = $pParamHash['edit'];
}
function markdown_parse_data( &$pParseHash, &$pCommonObject ) {
require_once( UTIL_PKG_PATH.'markdown.php' );
return Markdown( $pParseHash['data'] );
}
|