/** * Create a new commonmark converter instance. * * @param array $config * @param Environment|null $environment */ public function __construct(array $config = [], Environment $environment = null) { if ($environment === null) { $environment = Environment::createCommonMarkEnvironment(); } $environment->mergeConfig($config); parent::__construct(new DocParser($environment), new HtmlRenderer($environment)); }
public function __construct($addr_id, $user_id) { parent::__construct($addr_id); $this->user = $user_id; }
/** * constructor, see Markdownify::Markdownify() for more information */ public function __construct($linksAfterEachParagraph = self::LINK_AFTER_CONTENT, $bodyWidth = MDFY_BODYWIDTH, $keepHTML = MDFY_KEEPHTML) { parent::__construct($linksAfterEachParagraph, $bodyWidth, $keepHTML); // new markdownable tags & attributes // header ids: # foo {bar} $this->isMarkdownable['h1']['id'] = 'optional'; $this->isMarkdownable['h1']['class'] = 'optional'; $this->isMarkdownable['h2']['id'] = 'optional'; $this->isMarkdownable['h2']['class'] = 'optional'; $this->isMarkdownable['h3']['id'] = 'optional'; $this->isMarkdownable['h3']['class'] = 'optional'; $this->isMarkdownable['h4']['id'] = 'optional'; $this->isMarkdownable['h4']['class'] = 'optional'; $this->isMarkdownable['h5']['id'] = 'optional'; $this->isMarkdownable['h5']['class'] = 'optional'; $this->isMarkdownable['h6']['id'] = 'optional'; $this->isMarkdownable['h6']['class'] = 'optional'; // tables $this->isMarkdownable['table'] = array(); $this->isMarkdownable['th'] = array('align' => 'optional'); $this->isMarkdownable['td'] = array('align' => 'optional'); $this->isMarkdownable['tr'] = array(); array_push($this->ignore, 'thead'); array_push($this->ignore, 'tbody'); array_push($this->ignore, 'tfoot'); // definition lists $this->isMarkdownable['dl'] = array(); $this->isMarkdownable['dd'] = array(); $this->isMarkdownable['dt'] = array(); // link class $this->isMarkdownable['a']['id'] = 'optional'; $this->isMarkdownable['a']['class'] = 'optional'; // footnotes $this->isMarkdownable['fnref'] = array('target' => 'required'); $this->isMarkdownable['footnotes'] = array(); $this->isMarkdownable['fn'] = array('name' => 'required'); $this->parser->blockElements['fnref'] = false; $this->parser->blockElements['fn'] = true; $this->parser->blockElements['footnotes'] = true; // abbr $this->isMarkdownable['abbr'] = array('title' => 'required'); // build RegEx lookahead to decide wether table can pe parsed or not $inlineTags = array_keys($this->parser->blockElements, false); $colContents = '(?:[^<]|<(?:' . implode('|', $inlineTags) . '|[^a-z]))*'; $this->tableLookaheadHeader = '{ ^\\s*(?:<thead\\s*>)?\\s* # open optional thead <tr\\s*>\\s*(?: # start required row with headers <th(?:\\s+align=("|\')(?:left|center|right)\\1)?\\s*> # header with optional align \\s*' . $colContents . '\\s* # contents </th>\\s* # close header )+</tr> # close row with headers \\s*(?:</thead>)? # close optional thead }sxi'; $this->tdSubstitute = '\\s*' . $colContents . '\\s* # contents </td>\\s*'; $this->tableLookaheadBody = '{ \\s*(?:<tbody\\s*>)?\\s* # open optional tbody (?:<tr\\s*>\\s* # start row %s # cols to be substituted </tr>)+ # close row \\s*(?:</tbody>)? # close optional tbody \\s*</table> # close table }sxi'; }
public function __construct() { parent::__construct(); $this->setRowConverter(new ObjectArraySerializer()); }
public function __construct(array $input, $baseEncodings = array('UTF-8', 'ISO-8859-1')) { parent::__construct($input, $baseEncodings); }
public function __construct() { parent::__construct('addons', 'en', self::HOMEPAGE); }