1<?php
2if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/');
3if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
4require_once(DOKU_PLUGIN.'syntax.php');
5
6// compare
7// https://github.com/splitbrain/dokuwiki/pull/3798/files#diff-04c8b615576808e5dc67098f688fe22149d1413014752bf15234c0569690e984
8
9// from Html.php
10
11class HtmlOK_addendum extends DokuWiki_Syntax_Plugin {
12
13    function getSort() { return 190;  }
14    function getType() { return 'disabled';  }
15    function getAllowedTypes() { return array(); }
16	//! check if we really, REALLY want to enable HTML
17	function htmlok_but_truly_ok () {
18		// are you sure?
19		if (intval($this->getConf('use_sure')) < 1) return false;
20		// are you *really* sure?
21		if (intval($this->getConf('use_really_sure')) < 1) return false;
22		return true;
23	}
24
25	function html_sanitize ($html, $mode, $wrapper='code') {
26		// invoke here an external sanitizer
27		//$html= html_external_sanitizer($html);
28		return $html;
29	}
30
31    function handle ($match, $state, $pos, Doku_Handler $handler) {
32		switch ($state) {
33			case DOKU_LEXER_ENTER : {
34				return array($state, $match);
35			}
36			case DOKU_LEXER_UNMATCHED : {
37				$match= $this->html_sanitize($match, 'code');
38				return array($state, $match);
39			}
40			case DOKU_LEXER_EXIT : {
41				return array($state, $match);
42			}
43			case DOKU_LEXER_SPECIAL :
44				return array($state, $match);
45		}
46		return array();
47    }
48
49    function render ($mode, Doku_Renderer $renderer, $data) { }
50
51};
52
53?>
54