prettify tweaks
This commit is contained in:
parent
227d6a2049
commit
20006af4fe
@ -15,10 +15,14 @@ class Post
|
||||
el.removeAttribute 'rel'
|
||||
for el in $$ 'img[src]', root2
|
||||
el.src = el.src.replace /^(\w+:\/\/)[0-2](\.t\.4cdn\.org\/)/, '$10$2'
|
||||
Fourchan.code.call nodes: comment: $ '.postMessage', root2
|
||||
for el in $$ 'pre[style=""]', root2
|
||||
el.removeAttribute 'style'
|
||||
textNodes = $.X './/text()', root2
|
||||
i = 0
|
||||
while node = textNodes.snapshotItem i++
|
||||
node.data = node.data.replace /\s+/g, ' '
|
||||
$.rm node if node.data is ''
|
||||
@normalizedOriginal = root2
|
||||
<% } %>
|
||||
|
||||
|
||||
@ -34,7 +34,9 @@ Fourchan =
|
||||
cb: @math
|
||||
code: ->
|
||||
return if @isClone
|
||||
apply = (e) -> pre.innerHTML = e.detail
|
||||
apply = (e) ->
|
||||
pre.innerHTML = e.detail
|
||||
$.addClass pre, 'prettyprinted'
|
||||
$.on window, 'prettyprint:cb', apply
|
||||
for pre in $$ '.prettyprint:not(.prettyprinted)', @nodes.comment
|
||||
$.event 'prettyprint', pre.innerHTML, window
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user