make sure partial has data before register

このコミットが含まれているのは:
Matthew Scragg 2014-09-10 11:09:29 -05:00
コミット 951fffb3eb
2個のファイルの変更8行の追加2行の削除

ファイルの表示

@ -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() %}
{% 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(){