From cb10c35ec9e75de50575da51396c7fd6af80254b Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sun, 24 Sep 2017 00:15:25 +0000 Subject: [PATCH] Modified the wrong html for code highlight, ended up highlighting the whole list at the same time, whoops --- webapp/titanembeds/static/js/embed.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webapp/titanembeds/static/js/embed.js b/webapp/titanembeds/static/js/embed.js index 3362379..30bf251 100644 --- a/webapp/titanembeds/static/js/embed.js +++ b/webapp/titanembeds/static/js/embed.js @@ -788,8 +788,8 @@ } function render_code_highlighting(element) { - element.each(function(i, block) { - var elem = $(block); + for (var i = 0; i < element.length; i++) { + var elem = $(element[i]); var codetext = elem.text(); var splitted = codetext.split("\n"); if (splitted.length > 1) { @@ -802,12 +802,12 @@ splitted.splice(0, 1); // delete first line var restOfCode = splitted.join("\n"); var highlighted = hljs.highlight(language, restOfCode, true); - element.html(highlighted.value); + elem.html(highlighted.value); } } } } - }); + } } function fill_discord_messages(messages, jumpscroll, replace=null) {