mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-05-05 11:00:47 +02:00
Xenforo: Move lazyload img code to all be in one place.
This commit is contained in:
parent
e288691d1c
commit
936a2409b4
1 changed files with 5 additions and 5 deletions
|
|
@ -220,6 +220,11 @@ class BaseXenForoForumAdapter(BaseSiteAdapter):
|
|||
|
||||
def make_soup(self,data):
|
||||
soup = super(BaseXenForoForumAdapter, self).make_soup(data)
|
||||
## img class="lazyload"
|
||||
## include lazy load images.
|
||||
for img in soup.find_all('img',{'class':'lazyload'}):
|
||||
img['src'] = img['data-src']
|
||||
|
||||
## after lazy load images, there are noscript blocks also
|
||||
## containing <img> tags. The problem comes in when they hit
|
||||
## book readers such as Kindle and Nook and then you see the
|
||||
|
|
@ -662,11 +667,6 @@ class BaseXenForoForumAdapter(BaseSiteAdapter):
|
|||
for qdiv in postbody.find_all('div',{'class':'quoteExpand'}):
|
||||
qdiv.extract() # Remove <div class="quoteExpand">click to expand</div>
|
||||
|
||||
## img alt="[IMG]" class="bbCodeImage LbImage lazyload
|
||||
## include lazy load images.
|
||||
for img in postbody.find_all('img',{'class':'lazyload'}):
|
||||
img['src'] = img['data-src']
|
||||
|
||||
# XenForo uses <base href="https://forums.spacebattles.com/" />
|
||||
return self.utf8FromSoup(self.getURLPrefix()+'/',postbody)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue