*
* @see also: https://www.dokuwiki.org/devel:css
*
* Allow inline StyleSheet in DW page.
*
* SYNTAX:
*
* ...
*
*/
require_once(dirname(__FILE__).'/embedder.php');
class syntax_plugin_inlinejs_embedcss extends syntax_plugin_inlinejs_embedder
{
public function getType()
{ // Syntax Type
return 'protected';
}
public function getPType()
{ // Paragraph Type
return 'block';
}
/**
* Connect pattern to lexer
*/
//protected $mode, $pattern;
public function preConnect()
{
// drop 'syntax_' from class name
$this->mode = substr(get_class($this), 7);
// syntax pattern
$this->pattern[1] = '(?=.*?)';
$this->pattern[4] = '';
}
/**
* Plugin features
*/
//protected $code = null;
/**
* Create output
*/
public function render($format, Doku_Renderer $renderer, $data)
{
list($state, $code) = $data;
if ($format != 'xhtml') return false;
$html = ''.DOKU_LF;
$renderer->doc .= $html;
return true;
}
}