span_gamut += array(
"doApiLinks" => 35,
);
parent::__construct();
}
public function safeTransform($content)
{
$content=$this->transform($content);
$purifier=new CHtmlPurifier;
return $purifier->purify($content);
}
public function _doHeaders_callback_setext($matches)
{
if ($matches[3] == '-' && preg_match('{^- }', $matches[1]))
return $matches[0];
$level = $matches[3][0] == '=' ? 1 : 2;
$text = $this->runSpanGamut($matches[1]);
$attr = $this->doHeaderId($text);
$block = "
content,
# so we need to fix that:
$bq = preg_replace_callback('{(\s*.+?
)}sx',
array(&$this, '_DoBlockQuotes_callback2'), $bq);
# Do blockquote tips/notes
$bq = preg_replace_callback('/^(\s*\s*)([^:]+):\s*/sxi',
array($this, 'doBlockquoteTypes'), $bq);
$attr= $this->_blockquoteType ? " class=\"{$this->_blockquoteType}\"" : '';
return "\n". $this->hashBlock("
\n$bq\n
")."\n\n";
}
public function doHeaderId($text)
{
$id = preg_replace('/[^a-z0-9]/', '-', strtolower($text));
$id = str_replace('/-{2,}/', '-', $id);
return " id=\"$id\"";
}
public function doBlockquoteTypes($matches)
{
if(($pos=strpos($matches[2],'|'))!==false)
{
$type_str=substr($matches[2],$pos+1);
$this->_blockquoteType=strtolower(substr($matches[2],0,$pos));
}
else
{
$this->_blockquoteType = strtolower($matches[2]);
$type_str= ucwords($this->_blockquoteType);
}
return "$type_str: ";
}
public function doApiLinks($text)
{
return preg_replace_callback('/(?$text";
return $this->hashPart($link);
}
}