diff --git a/README.md b/README.md index e7e6d76..efe02d8 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,11 @@ that does some markdown rendering. ``` cd ./modules -https://git.hangar.org/arcHIVE-tech/SimpleMDText/archive/main.zip +https://git.hangar.org/arcHIVE-tech/SimpleMarkdown-omeka-module/archive/main.zip unzip main.zip -mv simpletext/ SimpleMDText +rm main.zip +mv simplemarkdown-omeka-module/ SimpleMDText +cd SimpleMDText composer install ``` diff --git a/src/Site/BlockLayout/SimpleMDText.php b/src/Site/BlockLayout/SimpleMDText.php index b521743..838753e 100644 --- a/src/Site/BlockLayout/SimpleMDText.php +++ b/src/Site/BlockLayout/SimpleMDText.php @@ -10,7 +10,16 @@ use Laminas\View\Renderer\PhpRenderer; use Laminas\Form\FormElementManager; use SimpleMDText\Form\SimpleMDTextBlockForm; -require_once(dirname(__DIR__, 3) . '/vendor/erusev/parsedown/Parsedown.php'); +$list_of_includes = get_included_files(); +$parsedown_included=false; +foreach ($list_of_includes as $file_path) { + if (false !== strpos($file_path, "Parsedown.php")) { + $parsedown_included=true; + } +} +if ($parsedown_included == false){ + require_once(dirname(__DIR__, 3) . '/vendor/autoload.php'); +} use Parsedown;