From 18067b6e56c1d40838bf6f4b04fd703d6670c080 Mon Sep 17 00:00:00 2001 From: Michael Ochmann Date: Tue, 23 Aug 2022 15:18:07 +0200 Subject: [PATCH] added `strict` mode --- src/Parkdown.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Parkdown.php b/src/Parkdown.php index 9edcb83..b3103a4 100644 --- a/src/Parkdown.php +++ b/src/Parkdown.php @@ -8,11 +8,11 @@ class Parkdown { private string $sourceCode; private DOMDocument $tree_; - public function __construct(string $sourceCode) { + public function __construct(string $sourceCode, bool $strict = false, ?string $fileName = null) { $this->sourceCode = $sourceCode; - $lexer = new Lexer($this->sourceCode); - $parser = new Parser($lexer->tokenize()); + $lexer = new Lexer($this->sourceCode, $fileName); + $parser = new Parser($lexer->tokenize(), $strict); $this->tree_ = $parser->parse(); }