You are here

function MarkdownExtra_Parser::hashHTMLBlocks in Markdown 6

Same name and namespace in other branches
  1. 5 markdown.php \MarkdownExtra_Parser::hashHTMLBlocks()

Overrides Markdown_Parser::hashHTMLBlocks

File

./markdown.php, line 1909

Class

MarkdownExtra_Parser

Code

function hashHTMLBlocks($text) {

  #

  # Hashify HTML Blocks and "clean tags".

  #

  # We only want to do this for block-level HTML tags, such as headers,

  # lists, and tables. That's because we still want to wrap <p>s around

  # "paragraphs" that are wrapped in non-block-level tags, such as anchors,

  # phrase emphasis, and spans. The list of tags we're looking for is

  # hard-coded.

  #

  # This works by calling _HashHTMLBlocks_InMarkdown, which then calls

  # _HashHTMLBlocks_InHTML when it encounter block tags. When the markdown="1"

  # attribute is found within a tag, _HashHTMLBlocks_InHTML calls back

  #  _HashHTMLBlocks_InMarkdown to handle the Markdown syntax within the tag.

  # These two functions are calling each other. It's recursive!

  #
  if ($this->no_markup) {
    return $text;
  }

  #

  # Call the HTML-in-Markdown hasher.

  #
  list($text, ) = $this
    ->_hashHTMLBlocks_inMarkdown($text);
  return $text;
}