_MarkdownExtra_TmpImpl::doHeaders PHP Method

doHeaders() protected method

protected doHeaders ( $text )
    protected function doHeaders($text)
    {
        #
        # Redefined to add id and class attribute support.
        #
        # Setext-style headers:
        #	  Header 1  {#header1}
        #	  ========
        #
        #	  Header 2  {#header2 .class1 .class2}
        #	  --------
        #
        $text = preg_replace_callback('{
				(^.+?)								# $1: Header text
				(?:[ ]+ ' . $this->id_class_attr_catch_re . ' )?	 # $3 = id/class attributes
				[ ]*\\n(=+|-+)[ ]*\\n+				# $3: Header footer
			}mx', array($this, '_doHeaders_callback_setext'), $text);
        # atx-style headers:
        #	# Header 1        {#header1}
        #	## Header 2       {#header2}
        #	## Header 2 with closing hashes ##  {#header3.class1.class2}
        #	...
        #	###### Header 6   {.class2}
        #
        $text = preg_replace_callback('{
				^(\\#{1,6})	# $1 = string of #\'s
				[ ]*
				(.+?)		# $2 = Header text
				[ ]*
				\\#*			# optional closing #\'s (not counted)
				(?:[ ]+ ' . $this->id_class_attr_catch_re . ' )?	 # $3 = id/class attributes
				[ ]*
				\\n+
			}xm', array($this, '_doHeaders_callback_atx'), $text);
        return $text;
    }