equal
deleted
inserted
replaced
300 def from_html_links_to_inline_imgs(content, inline=True, full_path=True): |
300 def from_html_links_to_inline_imgs(content, inline=True, full_path=True): |
301 """ |
301 """ |
302 Replaces (html) links to attachs with embeded inline images |
302 Replaces (html) links to attachs with embeded inline images |
303 """ |
303 """ |
304 content = re.sub("%s" %settings.SITE_URL, '', content) # changes absolute urls to relative urls |
304 content = re.sub("%s" %settings.SITE_URL, '', content) # changes absolute urls to relative urls |
305 attach_re = r'(?:/text/(?P<key>\w*))?/attach/(?P<attach_key>\w*)/' |
305 attach_re = r'"(?:/text/(?P<key>\w*))?/attach/(?P<attach_key>\w*)/' |
306 attach_str_textversion = r'/text/%s/attach/%s/' |
306 attach_str_textversion = r'/text/%s/attach/%s/' |
307 attach_str = r'/attach/%s/' |
307 attach_str = r'/attach/%s/' |
308 for match in re.findall(attach_re, content): |
308 for match in re.findall(attach_re, content): |
309 if match[0]: |
309 if match[0]: |
310 link = attach_str_textversion %match |
310 link = attach_str_textversion %match |