This commit is contained in:
Kovid Goyal 2014-08-17 10:43:54 +05:30
parent 4f4b64e33b
commit 63b512054c

View File

@ -121,13 +121,15 @@ def flip_images(raw):
for match in re.finditer(b'<IMG[^>]+/?>', raw, flags=re.I):
img = match.group()
m = re.search(br'class="(x|y|xy)flip"', img)
if m is None: continue
if m is None:
continue
flip = m.group(1)
src = re.search(br'src="([^"]+)"', img)
if src is None: continue
if src is None:
continue
img = src.group(1)
if not os.path.exists(img): continue
if not os.path.exists(img):
continue
flip_image(img, flip)
raw = re.sub(br'<STYLE.+?</STYLE>\s*', b'', raw, flags=re.I|re.DOTALL)
return raw