Now properly escaping JS and converting new lines into br for Tooltips.
Patch by: Mario Ferraro, Lennard de Rijk
--- a/app/soc/templates/soc/templatetags/_as_table_row.html Mon Jul 06 16:13:27 2009 +0200
+++ b/app/soc/templates/soc/templatetags/_as_table_row.html Mon Jul 06 16:21:51 2009 +0200
@@ -54,7 +54,7 @@
{% if help_text %}
<script type="text/javascript">
$(document).ready( function() {
- var tooltip = "<div class='tooltip'><div class='tooltip-body'><img src='/soc/content/images/purrInfo.png' alt='' /><h3>Info</h3><p>{{ help_text }}</p></div><div class='tooltip-bottom'></div></div>";
+ var tooltip = "<div class='tooltip'><div class='tooltip-body'><img src='/soc/content/images/purrInfo.png' alt='' /><h3>Info</h3><p>{% autoescape off %}{{ help_text|linebreaksbr|escapejs }}{% endautoescape %}</p></div><div class='tooltip-bottom'></div></div>";
var tooltip_object=null;
var documented = $("#{{ field_id }}");
var not_fieldset = documented.attr('tagName') !== 'FIELDSET';