catalog: use copy of comment HTML from before running features like Linkify/Embed

This commit is contained in:
ccd0 2014-09-16 19:42:45 -07:00
parent 8a29978882
commit 58973e4651
2 changed files with 7 additions and 2 deletions

View File

@ -353,7 +353,7 @@ Build =
'<span class="thread-icons"></span>' +
'</div>' +
'&{subject}' +
'<div class="comment">&{thread.OP.nodes.comment}</div>'
'<div class="comment">&{thread.OP.info.commentHTML}</div>'
) %>
root.dataset.fullID = thread.fullID

View File

@ -86,6 +86,7 @@ class Post
parseComment: ->
# Merge text nodes and remove empty ones.
@nodes.comment.normalize()
# Get the comment's text.
# <br> -> \n
# Remove:
@ -98,7 +99,11 @@ class Post
for node in $$ '.abbr, .exif, b', bq
$.rm node
@info.comment = @nodesToText bq
# Hide spoilers.
# Save cleaned comment HTML.
@info.commentHTML = <%= html('&{bq}') %>
# Get the comment's text with spoilers hidden.
spoilers = $$ 's', bq
@info.commentSpoilered = if spoilers.length
for node in spoilers