开发者

Google App Engine - function which clean string from html tags

I have a question if there is any function which can clean a string from html tags in google app engine api?

For example I have textarea - comments and somebody wrote:

 <b> Bla bla bla </b>

I want to clean it. Is there any function to do it? or I should write my own?

I know there is cgi.escape() and the tags are ignored but they are stil开发者_JAVA技巧l in this string Thanks


I do it this way

defaultfilters.striptags(text)


You almost certainly want to rely on your templating engine to do this. Most or all templating systems include this functionality - in Django, you use the |escape filter - and escaping on output is far more flexible than doing it on input.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜