diff --git a/src/Miscellaneous/Fourchan.coffee b/src/Miscellaneous/Fourchan.coffee index edb2fd36b..95f418ab4 100644 --- a/src/Miscellaneous/Fourchan.coffee +++ b/src/Miscellaneous/Fourchan.coffee @@ -32,13 +32,9 @@ Fourchan = cb: @math code: -> return if @isClone - for pre in $$ '.prettyprint', @nodes.comment - # Don't pretty print twice: - # Might need a better way to detect if a .prettyprint - # is already pretty-printed. We can't just look for spans - # since 4chan inserts its quotes and whatnot inside. - unless $ '.pln', pre - $.event 'prettyprint', pre, window + for pre in $$ '.prettyprint:not(.prettyprinted)', @nodes.comment + $.event 'prettyprint', pre, window + $.addClass pre, 'prettyprinted' return math: -> return if @isClone or !$ '.math', @nodes.comment diff --git a/src/Quotelinks/Quotify.coffee b/src/Quotelinks/Quotify.coffee index 8f94ee226..2e8ef7e10 100644 --- a/src/Quotelinks/Quotify.coffee +++ b/src/Quotelinks/Quotify.coffee @@ -15,7 +15,7 @@ Quotify = return parseDeadlink: (deadlink) -> - if deadlink.parentNode.className is 'prettyprint' + if $.hasClass deadlink.parentNode, 'prettyprint' # Don't quotify deadlinks inside code tags, # un-`span` them. # This won't be necessary once 4chan