i write a page ,the layout tmp is get from another server ,i render the data on the page ,it is just as a string on the page not as the html tags show it.
is there a fun to render the page on this question?
---------------------------more---------------------
example: test\
my server‘s ip is 10.101.100.1
I get a template string from interface http://10.101.100.3/template
The interface data returned is "\
I assign the data to a variable named str
index.js:
var data.header = str;
data.list={a:1,b:2,c:3};
var html = env.render('index.html',data);
ctx.response.body = html;
index.html:
{{ str }}
\
{{ f }}\
then,
In the browser, list is ok,but header tag in the str is as the string output in the page when i opend the page
browser show:
\ test\
1
2
3
Can you be more specific? It's unclear what you're trying to do and what doesn't work. Thanks!
I have a gut sense that you're looking for the escape safe filter, but I could be incorrect.
EDIT: I still think you're looking for the safe filter. Try this:
{{ str | safe }}
Most helpful comment
I have a gut sense that you're looking for the
escapesafe filter, but I could be incorrect.EDIT: I still think you're looking for the safe filter. Try this: