Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache lib url check #43

Merged
merged 1 commit into from
Jul 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions mermaid2/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ def mermaid_lib(self) -> str:
"""
Provides the actual mermaid library used
"""
mermaid_version = self.config['version']
lib = self.extra_mermaid_lib or MERMAID_LIB % mermaid_version
if not url_exists(lib):
raise FileNotFoundError("Cannot find Mermaid library: %s" %
lib)
return lib

if not hasattr(self, '_mermaid_lib'):
mermaid_version = self.config['version']
lib = self.extra_mermaid_lib or MERMAID_LIB % mermaid_version
if not url_exists(lib):
raise FileNotFoundError("Cannot find Mermaid library: %s" %
lib)
self._mermaid_lib = lib
return self._mermaid_lib

@property
def activate_custom_loader(self) -> bool:
Expand Down