diff --git a/.gitignore b/.gitignore index 894a44c..c5880db 100644 --- a/.gitignore +++ b/.gitignore @@ -98,7 +98,7 @@ venv.bak/ .ropeproject # mkdocs documentation -/site +site/ # mypy .mypy_cache/ diff --git a/mermaid2/plugin.py b/mermaid2/plugin.py index 8bbfe31..6646c99 100755 --- a/mermaid2/plugin.py +++ b/mermaid2/plugin.py @@ -265,18 +265,23 @@ def on_post_page(self, output_content, config, page, **kwargs): new_tag = soup.new_tag("script") js_code = [] # the code lines if not self.extra_javascript: + javascript = self.javascript.strip() + if not javascript.startswith("http"): + # it is necessary to adapt the link + javascript = os.path.relpath(javascript, + os.path.dirname(page.url)) # if no extra library mentioned, # add the