noahmorrison / chevron

A Python implementation of mustache
MIT License
505 stars 55 forks source link

allow bypassing html_escaping #81

Closed mistercrunch closed 3 years ago

mistercrunch commented 3 years ago

In some cases mustache/chevron can be used to template strings that are not html, for example templating SQL or other languages/strings like markdown.

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling ebdd476c3f341addeb156c174468b8e9b11b43d7 on mistercrunch:no_escape into 78f1a384eddef16906732d8db66deea6d37049b7 on noahmorrison:master.

dcmoore-gd commented 3 years ago

Would the existing {{{ ... }}} syntax not be sufficient for those use cases?

mistercrunch commented 3 years ago

Oh. {{{ ... }}} is a great workaround for us that I wasn't aware off, though html-escaping in our context never makes any sense and not using it should be more the rule than the exception. I think that's true of all templating use-cases that are not targeting HTML.

mistercrunch commented 3 years ago

closes https://github.com/noahmorrison/chevron/issues/79

noahmorrison commented 3 years ago

I'm going to reject this in favor of using the triple brackets, which is what the spec recommends.

I'm not horrendously opposed to implementing this, it just seems unnecessary. Maybe I'll add a non-html mode later on if there's more community desire for such a mode.