mprivat / mkdocs-snippet-plugin

An mkdocs plugin that injects snippets from a file in a git repository
MIT License
12 stars 3 forks source link

comment in code block causes incomplete view in mkdocs #9

Open devstek opened 1 year ago

devstek commented 1 year ago

Hi there,

im using current setup: mkdocs==1.4.2 mkdocs-macros-plugin==0.7.0 mkdocs-material==9.0.3 mkdocs-material-extensions==1.1.1 mkdocs-snippet-plugin==1.0.2

When including an extra site which has a comment in code block, causes an incomplete view of the page.

Base Site:

# Heading

{{ snippet('git@example.com:some/other/project.git', 'README.md', '# Heading Include Page') }}

Include Page:

# Heading Include Page

Lorem ipsum
\```
# This comment causing trouble
time
\```

Lorem ipsum
Lorem ipsum

So in included page the comment for time command, causes that mkdocs-snippet thinks it has finished and page view is incomplete.

Needed to put an \ for the code block with comment, due can't put code in code block.