diff --git a/r2/r2/public/static/js/jquery.reddit.js b/r2/r2/public/static/js/jquery.reddit.js index 75f1f6a13..960875959 100644 --- a/r2/r2/public/static/js/jquery.reddit.js +++ b/r2/r2/public/static/js/jquery.reddit.js @@ -331,7 +331,7 @@ $.fn.thing_id = function(class_filter) { t = t.find("." + class_filter + ":first"); } if(t.length) { - var id = $.grep(t.get(0).className.split(' '), + var id = $.grep(t.get(0).className.match(/\S+/g), function(i) { return i.match(/^id-/); }); return (id.length) ? id[0].slice(3, id[0].length) : ""; } diff --git a/r2/r2/templates/printable.html b/r2/r2/templates/printable.html index b36523594..721795e52 100644 --- a/r2/r2/templates/printable.html +++ b/r2/r2/templates/printable.html @@ -45,9 +45,7 @@ ${self.RenderPrintable()} %endif -<%def name="thing_css_class(what)"> -thing id-${what._fullname} - +<%def name="thing_css_class(what)">thing id-${what._fullname} <%def name="RenderPrintable()"> <% cls = thing.lookups[0].__class__.__name__.lower() %>