BorisMoore / jsrender

A lightweight, powerful and highly extensible templating engine. In the browser or on Node.js, with or without jQuery.
http://www.jsviews.com
MIT License
2.68k stars 340 forks source link

Empty Tag Causing A Syntax Error #223

Closed nfplee closed 10 years ago

nfplee commented 10 years ago

If I say:

{{:text}}

Where text is:

<p></p>

Then it throws the error:

"JsRender Error: Syntax error '<p... />' in: #1`#2`..."

BorisMoore commented 10 years ago

I haven't seen that issue. Can you create a jsfiddle or a complete example of what you are doing? Thanks.

nfplee commented 10 years ago

I've just played around with this and realized my safe html format function was converting <p></p> to <p />. I re-produced the problem with jsfiddle:

http://jsfiddle.net/7Yxg4/

However on review I don't consider this to be a bug with jsRender but with my html sanitizer. Therefore I have closed the issue.

BorisMoore commented 10 years ago

Yes, JsViews validates for badly formed HTML such as <p/>