diff --git a/src/codehelp/prompts.py b/src/codehelp/prompts.py index 42680f8..98bca10 100644 --- a/src/codehelp/prompts.py +++ b/src/codehelp/prompts.py @@ -57,6 +57,7 @@ - Do not write a corrected or updated version of the student's code. You must not write code for the student. - Use Markdown formatting, including ` for inline code. +- Use TeX syntax for mathematical formulas, wrapping them in \\(...\\) or \\[...\\] as appropriate. - Do not write a heading for the response. - Do not write any example code blocks. - If the student wrote in a language other than English, always respond in the student's own language. diff --git a/src/codehelp/templates/help_view.html b/src/codehelp/templates/help_view.html index 8a0722b..2beed48 100644 --- a/src/codehelp/templates/help_view.html +++ b/src/codehelp/templates/help_view.html @@ -7,10 +7,17 @@ {% extends "base.html" %} {% from "recent_queries.html" import recent_queries %} +{% block extrahead %} + + + +{% endblock %} + {% block body %}
-
+
{% if query %}
diff --git a/src/gened/filters.py b/src/gened/filters.py index 962f69f..4f569ea 100644 --- a/src/gened/filters.py +++ b/src/gened/filters.py @@ -63,7 +63,8 @@ def fmt_response_txt(value: str) -> str: return markupsafe.Markup(html_string) # Jinja filter for converting Markdown to HTML - markdown_processor = MarkdownIt("js-default") # https://markdown-it-py.readthedocs.io/en/latest/security.html + markdown_processor = MarkdownIt("js-default") # js-default: https://markdown-it-py.readthedocs.io/en/latest/security.html + markdown_processor.inline.ruler.disable(['escape']) # disable escaping so that \(, \[, etc. come through for TeX math @app.template_filter('markdown') def markdown_filter(value: str) -> str: