From 81d1bb7465af6caba19f8ab590feeac7bedd0cb5 Mon Sep 17 00:00:00 2001 From: Matt Molyneaux Date: Sun, 7 Apr 2024 15:23:51 +0100 Subject: [PATCH] Don't use the typogriphy jinja template, it is broken --- exhibition/filters/jinja2.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/exhibition/filters/jinja2.py b/exhibition/filters/jinja2.py index d2f5b67..9d29275 100644 --- a/exhibition/filters/jinja2.py +++ b/exhibition/filters/jinja2.py @@ -37,7 +37,7 @@ from jinja2.nodes import CallBlock, Const, ContextReference from markdown import markdown as md_func from pypandoc import convert_text as pandoc_func -from typogrify.templatetags import jinja_filters as typogrify_filters +from typogrify.filters import amp, caps, initial_quotes, smartypants, titlecase, typogrify, widont from exhibition.filters.base import BaseFilter from exhibition.filters.markdown import DEFAULT_MD_KWARGS, MARKDOWN_META_CONFIG @@ -203,7 +203,14 @@ def add_template_filters(self, env): env.filters["metasort"] = metasort env.filters["metaselect"] = metaselect env.filters["metareject"] = metareject - typogrify_filters.register(env) + # typogriphy filters + env.filters['amp'] = amp + env.filters['caps'] = caps + env.filters['initial_quotes'] = initial_quotes + env.filters['smartypants'] = smartypants + env.filters['titlecase'] = titlecase + env.filters['typogrify'] = typogrify + env.filters['widont'] = widont for name, flt in self.extra_filters.items(): env.filters[name] = flt