Skip to content

Commit

Permalink
Do not parse HTML pages if we know there are no mermaid charts
Browse files Browse the repository at this point in the history
  • Loading branch information
ribetm committed Jul 19, 2021
1 parent b3d5682 commit 3d1ae86
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mermaid2/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ def on_post_page(self, output_content, config, page, **kwargs):
Actions for each page:
generate the HTML code for all code items marked as 'mermaid'
"""
if "mermaid" not in output_content:
# Skip unecessary HTML parsing
return output_content
soup = BeautifulSoup(output_content, 'html.parser')
page_name = page.title
# first, determine if the page has diagrams:
Expand Down

0 comments on commit 3d1ae86

Please sign in to comment.