* @copyright (C) 2015-2020, Giuseppe Di Terlizzi
*/
class syntax_plugin_bootswrapper_macros extends DokuWiki_Syntax_Plugin
{
private $macros = array(
'~~CLEARFIX~~',
'~~PAGEBREAK~~',
);
public function getType()
{
return 'substition';
}
public function getSort()
{
return 99;
}
public function getPType()
{
return 'normal';
}
public function connectTo($mode)
{
foreach ($this->macros as $macro) {
$this->Lexer->addSpecialPattern($macro, $mode, 'plugin_bootswrapper_macros');
}
}
public function handle($match, $state, $pos, Doku_Handler $handler)
{
return array($match, $state, $pos);
}
public function render($mode, Doku_Renderer $renderer, $data)
{
if (empty($data)) {
return false;
}
if ($mode !== 'xhtml') {
return false;
}
list($match, $state, $pos) = $data;
switch ($match) {
case '~~CLEARFIX~~':
$renderer->doc .= '';
break;
case '~~PAGEBREAK~~':
$renderer->doc .= '';
break;
}
}
}