From 458f597657b02f74afe6beb9690ead653cc86bea Mon Sep 17 00:00:00 2001 From: Janne Koschinski <janne@kuschku.de> Date: Fri, 13 Oct 2017 14:19:45 +0200 Subject: [PATCH] =?UTF-8?q?Removes=20debug=20logging,=20fixes=20an=20issue?= =?UTF-8?q?=20where=20new=20search=20entries=20weren=E2=80=99t=20properly?= =?UTF-8?q?=20stored,=20fixes=20improper=20escaping=20of=20>=20<=20in=20te?= =?UTF-8?q?xt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- res/js/component/history.js | 4 +--- res/js/component/history.jsx | 6 +----- res/js/util/mirccolorhandler.js | 5 ++++- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/res/js/component/history.js b/res/js/component/history.js index 5e555f2..0306d39 100644 --- a/res/js/component/history.js +++ b/res/js/component/history.js @@ -63,7 +63,6 @@ class HistoryView { this.index %= this.elements.length; if (this.elements[this.index]) this.elements[this.index].focus(true); - console.log(this.index); } navigateLater() { if (this.elements[this.index]) @@ -75,7 +74,6 @@ class HistoryView { this.index %= this.elements.length; if (this.elements[this.index]) this.elements[this.index].focus(true); - console.log(this.index); } resetNavigation() { if (this.elements[this.index]) @@ -84,6 +82,6 @@ class HistoryView { } truncate() { while (this.elements.length > HISTORY_MAX_LENGTH) - this.list.removeChild(this.elements.shift().elem); + this.list.removeChild(this.elements.pop().elem); } } \ No newline at end of file diff --git a/res/js/component/history.jsx b/res/js/component/history.jsx index b709b74..dad4dcb 100644 --- a/res/js/component/history.jsx +++ b/res/js/component/history.jsx @@ -79,8 +79,6 @@ class HistoryView { if (this.elements[this.index]) this.elements[this.index].focus(true); - - console.log(this.index); } navigateLater() { @@ -95,8 +93,6 @@ class HistoryView { if (this.elements[this.index]) this.elements[this.index].focus(true); - - console.log(this.index); } resetNavigation() { @@ -108,6 +104,6 @@ class HistoryView { truncate() { while (this.elements.length > HISTORY_MAX_LENGTH) - this.list.removeChild(this.elements.shift().elem); + this.list.removeChild(this.elements.pop().elem); } } \ No newline at end of file diff --git a/res/js/util/mirccolorhandler.js b/res/js/util/mirccolorhandler.js index 458d963..076eb5d 100644 --- a/res/js/util/mirccolorhandler.js +++ b/res/js/util/mirccolorhandler.js @@ -50,8 +50,11 @@ class MircColorHandler { elem.classList.add('irc_highlight'); return elem; }; + const unescape = function (str) { + return str.replace(/</g, '<').replace(/>/g, '>'); + }; const apply = function (lastTag, str, i, normalCount, nodes) { - const s = str.substr(i - normalCount, normalCount); + const s = unescape(str.substr(i - normalCount, normalCount)); if (normalCount === 0) return; if (lastTag.tagName === 'A') -- GitLab