diff --git a/realms/static/js/main.js b/realms/static/js/main.js index 180d438..278785d 100644 --- a/realms/static/js/main.js +++ b/realms/static/js/main.js @@ -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){ diff --git a/realms/templates/wiki/edit.html b/realms/templates/wiki/edit.html index d839710..0559e2b 100644 --- a/realms/templates/wiki/edit.html +++ b/realms/templates/wiki/edit.html @@ -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(){