Update prettyPrinting support.

This commit is contained in:
Mayhem 2013-08-14 15:46:15 +02:00
parent e0a44bcb69
commit 10c8ccc90d
2 changed files with 4 additions and 8 deletions

View File

@ -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

View File

@ -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