You are here

function MarkdownExtra_Parser::stripAbbreviations in Markdown 5

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

File

./markdown.php, line 2748

Class

MarkdownExtra_Parser

Code

function stripAbbreviations($text) {

  #

  # Strips abbreviations from text, stores titles in hash references.

  #
  $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;
}