xref: /plugin/commonmark/action.php (revision ad615f37f3a8b728d060ef4ea32728f65217e3ec)
1<?php
2/**
3 * Commonmark Plugin test
4 */
5
6if(!defined('DOKU_INC')) die();
7
8class action_plugin_commonmark extends DokuWiki_Action_Plugin {
9    /**
10     * pass text to Commonmark parser before DW parser
11     */
12    public function register(Doku_Event_Handler $controller) {
13        $controller->register_hook('PARSER_WIKITEXT_PREPROCESS', 'BEFORE', $this,
14                                   '_commonmarkparse');
15    }
16
17    /**
18     * Parse commonmark text
19     * TEST: <!DOCTYPE markdown> to "PASSED!!"
20     */
21    public function _commonmarkparse(Doku_Event $event, $param) {
22        if (preg_match('/\A<!DOCTYPE markdown>/',$event->data)) {
23            $event->data = "===== WILL DW RENDERING WORK? =====";
24        }
25
26    }
27
28}