From d155eed8d77294bece1823cd08a6cdc5a8ea7106 Mon Sep 17 00:00:00 2001 From: noface Date: Sat, 15 Dec 2012 11:08:14 +0100 Subject: [PATCH 1/2] Fix deadquotes showing up in code-tags. --- 4chan_x.user.js | 4 ++++ changelog | 1 + script.coffee | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/4chan_x.user.js b/4chan_x.user.js index 8c622a4c0..14c34fd06 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -4316,6 +4316,10 @@ _ref = $$('.quote.deadlink', post.blockquote); for (_i = 0, _len = _ref.length; _i < _len; _i++) { deadlink = _ref[_i]; + if (deadlink.parentElement.className === 'prettyprint') { + $.replace(deadlink, deadlink.firstChild); + continue; + } quote = deadlink.textContent; a = $.el('a', { textContent: "" + quote + "\u00A0(Dead)" diff --git a/changelog b/changelog index 3139d6d31..3ffc20c2c 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,7 @@ master - noface Fix Anonymize not working on stubs. + Fix deadquotes showing up in code-tags. - Mayhem Fix selection quoting on Opera. Fix history bug with Persistent QR enabled on Chrome. diff --git a/script.coffee b/script.coffee index 4f6e93a89..dea587a50 100644 --- a/script.coffee +++ b/script.coffee @@ -3526,6 +3526,11 @@ Quotify = node: (post) -> return if post.isInlined and not post.isCrosspost for deadlink in $$ '.quote.deadlink', post.blockquote + + if deadlink.parentElement.className is 'prettyprint' + $.replace deadlink, deadlink.firstChild + continue + quote = deadlink.textContent a = $.el 'a', # \u00A0 is nbsp From debd002aab2538e89f06d973a1b1945cd621195e Mon Sep 17 00:00:00 2001 From: noface Date: Sat, 15 Dec 2012 13:55:43 +0100 Subject: [PATCH 2/2] Corrections. --- 4chan_x.user.js | 4 ++-- changelog | 2 +- script.coffee | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 14c34fd06..63a31bb07 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -4316,8 +4316,8 @@ _ref = $$('.quote.deadlink', post.blockquote); for (_i = 0, _len = _ref.length; _i < _len; _i++) { deadlink = _ref[_i]; - if (deadlink.parentElement.className === 'prettyprint') { - $.replace(deadlink, deadlink.firstChild); + if (deadlink.parentNode.className === 'prettyprint') { + $.replace(deadlink, Array.prototype.slice.call(deadlink.childNodes)); continue; } quote = deadlink.textContent; diff --git a/changelog b/changelog index 3ffc20c2c..f093c26bb 100644 --- a/changelog +++ b/changelog @@ -1,11 +1,11 @@ master - noface Fix Anonymize not working on stubs. - Fix deadquotes showing up in code-tags. - Mayhem Fix selection quoting on Opera. Fix history bug with Persistent QR enabled on Chrome. Fix posting warning not displaying the reason. + Fix deadquotes showing up in code-tags. 2.37.0 - noface diff --git a/script.coffee b/script.coffee index dea587a50..aa0d8c912 100644 --- a/script.coffee +++ b/script.coffee @@ -3527,8 +3527,8 @@ Quotify = return if post.isInlined and not post.isCrosspost for deadlink in $$ '.quote.deadlink', post.blockquote - if deadlink.parentElement.className is 'prettyprint' - $.replace deadlink, deadlink.firstChild + if deadlink.parentNode.className is 'prettyprint' + $.replace deadlink, Array::slice.call deadlink.childNodes continue quote = deadlink.textContent