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);
}