#!/usr/bin/env python
+from __future__ import print_function
import sys
import os
import glob
from util import Reporter, read_markdown, IMAGE_FILE_SUFFIX
-
def main():
"""Main driver."""
if (doc['type'] == 'img') or \
((doc['type'] == 'html_element') and (doc['value'] == 'img')):
- result.append({'alt': doc['attr']['alt'], 'src': doc['attr']['src']})
+ alt = doc['attr'].get('alt', '')
+ result.append({'alt': alt, 'src': doc['attr']['src']})
else:
for child in doc.get('children', []):
find_image_nodes(child, result)