mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-05-08 12:36:11 +02:00
Fix replace_failed_smilies_with_alt_text for XF2.
This commit is contained in:
parent
a6ec8fd1d8
commit
7d35b642fd
1 changed files with 2 additions and 2 deletions
|
|
@ -701,10 +701,10 @@ class BaseXenForoForumAdapter(BaseSiteAdapter):
|
|||
|
||||
def _do_utf8FromSoup(self,url,soup,fetch=None,allow_replace_br_with_p=True):
|
||||
if self.getConfig('replace_failed_smilies_with_alt_text'):
|
||||
for img in soup.find_all('img',src=re.compile(r'(failedtoload|clear.png)$')):
|
||||
for img in soup.find_all('img',src=re.compile(r'(^data:image|(failedtoload|clear.png)$)')):
|
||||
# logger.debug("replace_failed_smilies_with_alt_text img: %s"%img)
|
||||
clses = unicode(img['class']) # stringify list.
|
||||
if img.has_attr('alt') and 'mceSmilie' in clses :
|
||||
if img.has_attr('alt') and ('mceSmilie' in clses or 'smilie--sprite' in clses):
|
||||
## Change the img to a span containing the alt
|
||||
## text, remove attrs. This is a one-way change.
|
||||
img.name='span'
|
||||
|
|
|
|||
Loading…
Reference in a new issue