Markdownify\Converter::__construct PHP Method

__construct() public method

constructor, set options, setup parser
public __construct ( integer $linkPosition = self::LINK_AFTER_CONTENT, integer $bodyWidth = MDFY_BODYWIDTH, boolean $keepHTML = MDFY_KEEPHTML ) : void
$linkPosition integer define the position of links
$bodyWidth integer whether or not to wrap the output to the given width defaults to false
$keepHTML boolean whether to keep non markdownable HTML or to discard it defaults to true (HTML will be kept)
return void
    public function __construct($linkPosition = self::LINK_AFTER_CONTENT, $bodyWidth = MDFY_BODYWIDTH, $keepHTML = MDFY_KEEPHTML)
    {
        $this->linkPosition = $linkPosition;
        $this->keepHTML = $keepHTML;
        if ($bodyWidth > $this->minBodyWidth) {
            $this->bodyWidth = intval($bodyWidth);
        } else {
            $this->bodyWidth = false;
        }
        $this->parser = new Parser();
        $this->parser->noTagsInCode = true;
        // we don't have to do this every time
        $search = array();
        $replace = array();
        foreach ($this->escapeInText as $s => $r) {
            array_push($search, '@(?<!\\\\)' . $s . '@U');
            array_push($replace, $r);
        }
        $this->escapeInText = array('search' => $search, 'replace' => $replace);
    }