import htmlmin
from markupsafe import Markup

from qxlc import app


@app.template_filter("minify")
def minify_filter(text):
    return Markup(htmlmin.minify(text.unescape(), remove_comments=True, remove_empty_space=True))

import htmlmin
from markupsafe import Markup

from qxlc import app


@app.template_filter("minify")
def minify_filter(s):
    return Markup(htmlmin.minify(str(s), remove_comments=True, remove_empty_space=True))

Use str(s) instead of s.unescape() to add support for escaping things inside. (took me a while to find that str() worked)
Use str(s) instead of s.unescape() to add support for escaping things inside. (took me a while to find that str() worked)
