make sure partial has data before register
This commit is contained in:
parent
40292454da
commit
951fffb3eb
|
@ -75,7 +75,7 @@ var MDR = {
|
|||
if (sanitize) {
|
||||
// Causes some problems with inline styles
|
||||
html = html_sanitize(html, function(url) {
|
||||
if(/^https?:\/\//.test(url)) {
|
||||
if(/^(\/|https?:\/\/)/.test(url)) {
|
||||
return url
|
||||
}
|
||||
}, function(id){
|
||||
|
|
|
@ -4,7 +4,13 @@
|
|||
$(function(){
|
||||
{% if partials %}
|
||||
{% for name, value in partials.items() %}
|
||||
Handlebars.registerPartial({{ name|tojson|safe }}, {{ value.data|tojson|safe }});
|
||||
{% if name and value %}
|
||||
try {
|
||||
Handlebars.registerPartial({{ name|tojson|safe }}, {{ value.data|tojson|safe }});
|
||||
} catch(e) {
|
||||
// no data?
|
||||
}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
$("#start-togetherjs").click(function(){
|
||||
|
|
Loading…
Reference in a new issue