Fix #1325 and add test_find_empty_alt

This commit is contained in:
John 2016-11-17 23:15:46 +00:00
commit 6f9f0def0f
2 changed files with 25 additions and 2 deletions

View file

@ -584,7 +584,7 @@ def find_empty_alt(content, path):
# src before alt
<img
[^\>]*
src=(['"])(.*)\1
src=(['"])(.*?)\1
[^\>]*
alt=(['"])\3
)|(?:
@ -593,7 +593,7 @@ def find_empty_alt(content, path):
[^\>]*
alt=(['"])\4
[^\>]*
src=(['"])(.*)\5
src=(['"])(.*?)\5
)
""", re.X)
for match in re.findall(imgs, content):