Skip to content

tojson not marking items as safe per docs #709

@pleasantone

Description

@pleasantone

Expected Behavior

From the jinja docs:

"Note that this is available in templates through the |tojson filter which will also mark the result as safe. "

Actual Behavior

tojson doesn't seem to be marking the output as safe, so if we establish the jinja
environment with autoescape enabled, and then use tojson, we must add "|safe"
at the end.

Your Environment

  • Python version: 3.5.3
  • Jinja version: 2.9.6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions