From 7926894a45d2f56c7ff7c8275c72281e7988015d Mon Sep 17 00:00:00 2001 From: ccd0 Date: Wed, 1 Apr 2020 04:18:02 -0700 Subject: [PATCH] Eliminate needless normalize(). --- src/site/SW.tinyboard.coffee | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/site/SW.tinyboard.coffee b/src/site/SW.tinyboard.coffee index de0b5c9bd..84e2fe9d9 100644 --- a/src/site/SW.tinyboard.coffee +++ b/src/site/SW.tinyboard.coffee @@ -186,9 +186,14 @@ SW.tinyboard = parseNodes: (post, nodes) -> # Add vichan's span.poster_id around the ID if not already present. return if nodes.uniqueID - nodes.info.normalize() - {nextSibling} = nodes.nameBlock - if nextSibling.nodeType is 3 and (m = nextSibling.textContent.match /(\s*ID:\s*)(\S+)/) + text = '' + node = nodes.nameBlock.nextSibling + while node and node.nodeType is 3 + text += node.textContent + node = node.nextSibling + if (m = text.match /(\s*ID:\s*)(\S+)/) + nodes.info.normalize() + {nextSibling} = nodes.nameBlock nextSibling = nextSibling.splitText m[1].length nextSibling.splitText m[2].length nodes.uniqueID = uniqueID = $.el 'span', {className: 'poster_id'}