Method: flask.templating.render_template_string
Calls: 11, Exceptions: 0, Paths: 1Back
Path 1: 11 calls (1.0)
'{% if notanswer %}{{ notanswer }} is not the answer. {% endif %}{% if answer %}{{ answer }} is the answer.{% endif %}' (2) '{{ g.spam }}' (1) '{{ get...
{} (8) dict (1) {'config': 42} (1) {'foo': '
'42' (3) 'eggs' (1) '43 is not the answer. ' (1) '43 is not the answer. 42 is the answer.' (1) 'child' (1) 'const data = {"name": "\\u003c/script\\u00...
1def render_template_string(source: str, **context: t.Any) -> str:
2 """Render a template from the given source string with the given
3 context.
4
5 :param source: The source code of the template to render.
6 :param context: The variables to make available in the template.
7 """
8 app = current_app._get_current_object() # type: ignore[attr-defined]
9 template = app.jinja_env.from_string(source)
10 return _render(app, template, context)