You are here

protected function MarkdownExtra::stripAbbreviations in Express 8

* Abbreviations - strips abbreviations from text, stores titles in hash * references. *

Parameters

string $text: * @return string

File

vendor/michelf/php-markdown/Michelf/MarkdownExtra.php, line 1718

Class

MarkdownExtra
Markdown Extra Parser Class

Namespace

Michelf

Code

protected function stripAbbreviations($text) {
  $less_than_tab = $this->tab_width - 1;

  // Link defs are in the form: [id]*: url "optional title"
  $text = preg_replace_callback('{
			^[ ]{0,' . $less_than_tab . '}\\*\\[(.+?)\\][ ]?:	# abbr_id = $1
			(.*)					# text = $2 (no blank lines allowed)	
			}xm', array(
    $this,
    '_stripAbbreviations_callback',
  ), $text);
  return $text;
}