Markdown_Parser::Markdown_Parser PHP Method

Markdown_Parser() public method

public Markdown_Parser ( )
    function Markdown_Parser()
    {
        #
        # Constructor function. Initialize appropriate member variables.
        #
        $this->_initDetab();
        $this->prepareItalicsAndBold();
        $this->nested_brackets_re = str_repeat('(?>[^\\[\\]]+|\\[', $this->nested_brackets_depth) . str_repeat('\\])*', $this->nested_brackets_depth);
        $this->nested_url_parenthesis_re = str_repeat('(?>[^()\\s]+|\\(', $this->nested_url_parenthesis_depth) . str_repeat('(?>\\)))*', $this->nested_url_parenthesis_depth);
        $this->escape_chars_re = '[' . preg_quote($this->escape_chars) . ']';
        # Sort document, block, and span gamut in ascendent priority order.
        asort($this->document_gamut);
        asort($this->block_gamut);
        asort($this->span_gamut);
    }

Usage Example

 function MarkdownExtra_Parser()
 {
     #
     # Constructor function. Initialize the parser object.
     #
     # Add extra escapable characters before parent constructor
     # initialize the table.
     $this->escape_chars .= ':|';
     # Insert extra document, block, and span transformations.
     # Parent constructor will do the sorting.
     $this->document_gamut += array("doFencedCodeBlocks" => 5, "stripFootnotes" => 15, "stripAbbreviations" => 25, "appendFootnotes" => 50);
     $this->block_gamut += array("doFencedCodeBlocks" => 5, "doTables" => 15, "doDefLists" => 45);
     $this->span_gamut += array("doFootnotes" => 5, "doAbbreviations" => 70);
     parent::Markdown_Parser();
 }