1<?php
2
3class renderer_plugin_mermaid extends Doku_Renderer_xhtml
4{
5    function underline_open()
6    {
7        $xhtml = '<em class="u">';
8
9        $xhtml = htmlentities($xhtml, ENT_NOQUOTES);
10        $xhtml = str_replace(array('"'), array('\''), $xhtml);
11
12        $this->doc .= $xhtml;
13    }
14
15    function underline_close()
16    {
17        $xhtml = '</em>';
18
19        $xhtml = htmlentities($xhtml, ENT_NOQUOTES);
20        $xhtml = str_replace(array('"'), array('\''), $xhtml);
21
22        $this->doc .= $xhtml;
23    }
24
25    function internallink($id, $name = null, $search = null, $returnonly = false, $linktype = 'content')
26    {
27        $xhtml = parent::internallink($id, $name, $search, true, $linktype);
28
29        $xhtml = htmlentities($xhtml, ENT_NOQUOTES);
30        $xhtml = str_replace(array('"'), array('\''), $xhtml);
31
32        if($returnonly)
33        {
34            return $xhtml;
35        }
36        else
37        {
38            $this->doc .= $xhtml;
39        }
40    }
41
42    function externallink($url, $name = null, $returnonly = false)
43    {
44        $xhtml = parent::externallink($url, $name, true);
45
46        $xhtml = htmlentities($xhtml,ENT_NOQUOTES);
47        $xhtml = str_replace(array('"'), array('\''), $xhtml);
48
49        //output formatted
50        if($returnonly)
51        {
52            return $xhtml;
53        }
54        else
55        {
56            $this->doc .= $xhtml;
57        }
58    }
59
60    function internalmedia($src, $title = null, $align = null, $width = null, $height = null, $cache = null, $linking = null, $return = false)
61    {
62        $xhtml = parent::internalmedia($src, $title, $align, $width, $height, $cache, $linking, true);
63
64        $xhtml = htmlentities($xhtml,ENT_NOQUOTES);
65        $xhtml = str_replace(array('"'), array('\''), $xhtml);
66
67        //output formatted
68        if($return)
69        {
70            return $xhtml;
71        }
72        else
73        {
74            $this->doc .= $xhtml;
75        }
76    }
77
78    function cdata($text)
79    {
80        $this->doc .= $text;
81    }
82
83    public function p_open()
84    {
85    }
86
87    public function p_close()
88    {
89    }
90}