diff --git a/src/Configurables/DefinitionBook.php b/src/Configurables/DefinitionBook.php new file mode 100644 index 0000000..0e73db5 --- /dev/null +++ b/src/Configurables/DefinitionBook.php @@ -0,0 +1,54 @@ + */ + private $book; + + /** + * @param array $book + */ + public function __construct(array $book = []) + { + $this->book = $book; + } + + /** @return self */ + public static function default() + { + return new self; + } + + /** + * @param string $id + * @param _Data $data + * @return self + */ + public function setting($id, array $data) + { + $book = $this->book; + $book[$id] = $data; + + return new self($book); + } + + /** + * @param string $id + * @return _Data|null + */ + public function lookup($id) + { + if (isset($this->book[$id])) { + return $this->book[$id]; + } + + return null; + } +} diff --git a/src/Parsedown.php b/src/Parsedown.php index 6373805..99674e7 100644 --- a/src/Parsedown.php +++ b/src/Parsedown.php @@ -42,9 +42,6 @@ class Parsedown protected function textElements($text) { - # make sure no definitions are set - $this->DefinitionData = []; - # iterate through lines to identify blocks return $this->linesElements(Lines::fromTextLines($text, 0)); } @@ -1739,12 +1736,6 @@ class Parsedown private static $instances = []; - # - # Fields - # - - protected $DefinitionData; - # # Read-Only