Skip to content

Commit

Permalink
Fixes #26. (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
miffels authored Nov 2, 2020
1 parent 9af2957 commit b816b32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions markdownextradata/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from mkdocs.plugins import BasePlugin
from mkdocs.utils import warning_filter

from jinja2 import Template
import jinja2
from pathlib import Path
from itertools import chain

Expand Down Expand Up @@ -91,5 +91,6 @@ def on_pre_build(self, config, **kwargs):
def on_page_markdown(self, markdown, config, **kwargs):
context = {key: config.get(key) for key in CONFIG_KEYS if key in config}
context.update(config.get("extra", {}))
md_template = Template(markdown)
env = jinja2.Environment(undefined=jinja2.DebugUndefined)
md_template = env.from_string(markdown)
return md_template.render(**config.get("extra"))

0 comments on commit b816b32

Please sign in to comment.