Fix issues with prettyprinted code in post building tests.

This commit is contained in:
ccd0 2016-04-28 09:06:06 -07:00
parent 01e1c62a8f
commit d34a2473c0

View File

@ -12,7 +12,14 @@ class Post
el.setAttribute 'href', href
for el in $$ 'img[src]', root2
el.src = el.src.replace /(spoiler-\w+)\d(\.png)$/, '$11$2'
Fourchan.code.call nodes: comment: $ '.postMessage', root2
for el in $$ 'pre.prettyprinted', root2
nodes = $.X './/br|.//wbr|.//text()', el
i = 0
nodes = (node while (node = nodes.snapshotItem i++))
$.rmAll el
$.add el, nodes
el.normalize()
$.rmClass el, 'prettyprinted'
for el in $$ 'pre[style=""]', root2
el.removeAttribute 'style'
textNodes = $.X './/text()', root2