diff options
Diffstat (limited to '')
-rwxr-xr-x | pyblog | 12 |
1 files changed, 1 insertions, 11 deletions
@@ -783,16 +783,6 @@ def _pre_tag_insert_line_numbers(soup, pre_tag): pre_tag.code.append(ln_tag) -def link_img_tags(soup): - """Convert each <img> tag in <article> to a link to its original.""" - if not soup.article: - return - for img_tag in soup.article.find_all("img"): - a_tag = soup.new_tag("a", href=img_tag["src"], target="_blank") - a_tag.insert(0, copy.copy(img_tag)) - img_tag.replace_with(a_tag) - - def process_footnote_backlinks(soup): """Add class attribute "footnotes-backlink" to each footnote backlink.""" for footnotes in soup.find_all("div", attrs={"class": "footnotes"}): @@ -812,7 +802,7 @@ def postprocess_html_file(htmlfilepath): # a series of postprocessing (extensible) utils.process_image_sizes(soup) - link_img_tags(soup) + utils.link_img_tags(soup) process_footnote_backlinks(soup) # write back |