Closed denesl closed 3 years ago
@denesl Renoir uses an __html__
method on objects for escaping when available. You can mimic what Emmett does building a wrapper class:
class asis:
def __init__(self, val):
self.val = val
def __html__(self):
return str(self.val)
the you function just have to return the wrapped content
def f():
...
return asis(whatever)
or you can add you class in Renoir's context and call-it directly from the template:
{{ =asis(f()) }}
Hi
what is the Renoir syntax to output an unescaped HTML string created by a function in a template? If I have {{=f()}} in the template then I get an escaped string e.g. <div class="some-class" ... obviously I want <div class="some-class" ...
Thanks.