doHeaders() public method

public doHeaders ( $text )
Exemplo n.º 1
0
    function doHeaders($text)
    {
        /*
        Setext-style headers:
        Header 1
        		########
        Header 2
        		========
        Header 3
        		--------
        $text = preg_replace_callback
        		(
        		'{ ^(.+?)[ ]*\n(\#+|=+|-+)[ ]*\n+ }mx',
        array(&$this, '_doHeaders_callback_setext'), $text
        		);
        */
        $text = parent::doHeaders($text);
        /*
        atx-style headers:
        h1. Header 1
        		h2. Header 2
        		...
        		h6. Header 6
        */
        $text = preg_replace_callback('{
				^h([1-6])\\.	# $1 = string of h?
				[ ]*
				(.+?)		# $2 = Header text
				[ ]*
				\\n+
			}xm', array(&$this, '_doHeaders_callback_tp'), $text);
        return $text;
    }