Use childNodes[2] for finding file resolution

ExLinks support vanilla 4chan and can add in its reverse image search link to the .fileText before 4chan X manages to parse it. As a result, 4chan X ends up looking at the reverse image search link for dimensions instead of the correct text element. Using childNodes[2] instead of lastChild fixes this.
This commit is contained in:
Hupotronic 2014-04-30 15:38:07 +03:00
parent 2de487906c
commit 174e540ee2

View File

@ -148,7 +148,7 @@ class Post
@file.isImage = /(jpg|png|gif)$/i.test @file.name
@file.isVideo = /webm$/i.test @file.name
if @file.isImage or @file.isVideo
@file.dimensions = fileText.lastChild.data.match(/\d+x\d+/)[0]
@file.dimensions = fileText.childNodes[2].data.match(/\d+x\d+/)[0]
cleanup: (root, post) ->
for node in $$ '.mobile', root