Skip to content

Commit

Permalink
Merge pull request #121 from tsutaj/fix_sample_md_rendering_bug
Browse files Browse the repository at this point in the history
sample markdown, explanation のレンダリング時のバグ修正
  • Loading branch information
tsutaj authored Jan 30, 2023
2 parents 3645a15 + d13da7c commit fad38f6
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions statements_manager/src/variables_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import Any, Set

from jinja2 import DictLoader, Environment
from markdown import markdown

logger: Logger = getLogger(__name__)

Expand Down Expand Up @@ -183,9 +184,27 @@ def convert(
if output_file.exists():
sample_data["output_text"] = fetch_text(output_file)
if md_file.exists():
sample_data["md_text"] = fetch_text(md_file)
md_text = fetch_text(md_file)
md_text = markdown(
md_text,
extensions=[
"md_in_html",
"tables",
"fenced_code",
],
)
sample_data["md_text"] = md_text
if explanation_file.exists():
sample_data["explanation_text"] = fetch_text(explanation_file)
explanation_text = fetch_text(explanation_file)
explanation_text = markdown(
explanation_text,
extensions=[
"md_in_html",
"tables",
"fenced_code",
],
)
sample_data["explanation_text"] = explanation_text
sample_text = env.get_template("template").render(
sample_data=sample_data,
)
Expand Down

0 comments on commit fad38f6

Please sign in to comment.