You are here

protected function Markdown::_generateIdFromHeaderValue in Express 8

* If a header_id_func property is set, we can use it to automatically * generate an id attribute. * * This method returns a string in the form id="foo", or an empty string * otherwise. *

Parameters

string $headerValue: * @return string

2 calls to Markdown::_generateIdFromHeaderValue()
Markdown::_doHeaders_callback_atx in vendor/michelf/php-markdown/Michelf/Markdown.php
* ATX header parsing callback *
Markdown::_doHeaders_callback_setext in vendor/michelf/php-markdown/Michelf/Markdown.php
* Setext header parsing callback *

File

vendor/michelf/php-markdown/Michelf/Markdown.php, line 980

Class

Markdown
Markdown Parser Class

Namespace

Michelf

Code

protected function _generateIdFromHeaderValue($headerValue) {
  if (!is_callable($this->header_id_func)) {
    return "";
  }
  $idValue = call_user_func($this->header_id_func, $headerValue);
  if (!$idValue) {
    return "";
  }
  return ' id="' . $this
    ->encodeAttribute($idValue) . '"';
}