catalog: use copy of comment HTML from before running features like Linkify/Embed
This commit is contained in:
parent
8a29978882
commit
58973e4651
@ -353,7 +353,7 @@ Build =
|
|||||||
'<span class="thread-icons"></span>' +
|
'<span class="thread-icons"></span>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'&{subject}' +
|
'&{subject}' +
|
||||||
'<div class="comment">&{thread.OP.nodes.comment}</div>'
|
'<div class="comment">&{thread.OP.info.commentHTML}</div>'
|
||||||
) %>
|
) %>
|
||||||
|
|
||||||
root.dataset.fullID = thread.fullID
|
root.dataset.fullID = thread.fullID
|
||||||
|
|||||||
@ -86,6 +86,7 @@ class Post
|
|||||||
parseComment: ->
|
parseComment: ->
|
||||||
# Merge text nodes and remove empty ones.
|
# Merge text nodes and remove empty ones.
|
||||||
@nodes.comment.normalize()
|
@nodes.comment.normalize()
|
||||||
|
|
||||||
# Get the comment's text.
|
# Get the comment's text.
|
||||||
# <br> -> \n
|
# <br> -> \n
|
||||||
# Remove:
|
# Remove:
|
||||||
@ -98,7 +99,11 @@ class Post
|
|||||||
for node in $$ '.abbr, .exif, b', bq
|
for node in $$ '.abbr, .exif, b', bq
|
||||||
$.rm node
|
$.rm node
|
||||||
@info.comment = @nodesToText bq
|
@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
|
spoilers = $$ 's', bq
|
||||||
@info.commentSpoilered = if spoilers.length
|
@info.commentSpoilered = if spoilers.length
|
||||||
for node in spoilers
|
for node in spoilers
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user