本文整理匯總了PHP中Parsedown::blockHeader方法的典型用法代碼示例。如果您正苦於以下問題:PHP Parsedown::blockHeader方法的具體用法?PHP Parsedown::blockHeader怎麽用?PHP Parsedown::blockHeader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Parsedown
的用法示例。
在下文中一共展示了Parsedown::blockHeader方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: blockHeader
/**
* We don't want <h1> in our text
*
* @param $line
* @return array|null|void
*/
protected function blockHeader($line)
{
$block = parent::blockHeader($line);
if ($block && isset($block['element'])) {
if ($block['element']['name'] == 'h1') {
return null;
}
}
return $block;
}
示例2: blockHeader
protected function blockHeader($Line)
{
$Block = parent::blockHeader($Line);
if (preg_match('/[ #]*{(' . $this->regexAttribute . '+)}[ ]*$/', $Block['element']['text'], $matches, PREG_OFFSET_CAPTURE)) {
$attributeString = $matches[1][0];
$Block['element']['attributes'] = $this->attributeData($attributeString);
$Block['element']['text'] = substr($Block['element']['text'], 0, $matches[0][1]);
}
return $Block;
}
示例3: blockHeader
protected function blockHeader($line)
{
return $this->addHeaderInToc(parent::blockHeader($line));
}
示例4: blockHeader
protected function blockHeader($Line)
{
$e = parent::blockHeader($Line);
$text = $e['element']['name'];
// 注釋中的標題降兩級,並添加題標數
if (preg_match('/h(\\d+)/', $text, $ms)) {
$level = (int) $ms[1];
$titleNum = $this->getTitleNum($level);
$elem =& $e['element'];
$elem['name'] = "h" . ($level + 2);
$txt = $titleNum . " " . $elem['text'];
$elem['text'] = $txt;
global $options;
if ($options['subtoc']) {
if (!isset($elem['attributes'])) {
$elem['attributes'] = [];
}
global $curBlockId, $subTitles;
$elem['attributes']['id'] = subTocId($curBlockId, $txt);
$subTitles[] = $txt;
}
}
return $e;
}