Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compat tojson filter for jinja2 versions missing it #56596

Merged
merged 1 commit into from May 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/bin/plugin_formatter.py
Expand Up @@ -11,6 +11,7 @@

import datetime
import glob
import json
import optparse
import os
import re
Expand Down Expand Up @@ -399,6 +400,10 @@ def jinja2_environment(template_dir, typ, plugin_type):
# Jinja < 2.10
env.filters['max'] = do_max

if 'tojson' not in env.filters:
# Jinja < 2.9
env.filters['tojson'] = json.dumps

templates = {}
if typ == 'rst':
env.filters['rst_ify'] = rst_ify
Expand Down