leaguevine / leaguevine-ultistats

MIT License
18 stars 4 forks source link

tournament.info's escaped html #9

Closed cboulay closed 12 years ago

cboulay commented 12 years ago

The leaguevine API returns tournament.info as an escaped html string. The Tournament model object is stringified before it is passed to the template so the template interprets the string as a string, then the browser interprets the escaped html and shows the "<" instead of "&lt", for example. I probably need to overshadow the parse method and unescape the HTML in the info attribute. As far as I can tell there is no native unescape command that picks these up.

mliu7 commented 12 years ago

Fixed.

This had nothing to do with leaguevine-ultistats and everything to do with how the Leaguevine API was returning the HTML. If an info string had some good html and bad html, we should have returned it as:

<p>Good stuff</p>&ltBad Stuff&gt

but we were escaping everything and making it look like:

&ltp&gtGood stuff&lt/p&gt&ltBad Stuff&gt

which was wrong. It's fixed now and everything looks ok on the tournament pages that have HTML.