Feat: import work and verify compilation
This commit is contained in:
@@ -44,7 +44,7 @@ def process_content(article):
|
||||
soup = BeautifulSoup(article._content,'lxml')
|
||||
except FeatureNotFound:
|
||||
soup = BeautifulSoup(article._content,'html.parser')
|
||||
|
||||
|
||||
for img in soup.find_all('img',src=FORMAT_RE):
|
||||
src = re.sub(article.settings['INTRASITE_LINK_REGEX'],'',img['src'].strip())
|
||||
if src.startswith(('http://','https://','ftp://')): continue
|
||||
@@ -70,10 +70,10 @@ def process_content(article):
|
||||
png_url = '/'.join((siteurl, preview_dir, linked_content.url + '.png'))
|
||||
png_url = png_url.replace('\\', '/')
|
||||
img['src'] = png_url
|
||||
|
||||
|
||||
article._content = unicode(soup)
|
||||
|
||||
|
||||
|
||||
def get_pdf_imgs(generators):
|
||||
# Process the articles and pages
|
||||
for generator in generators:
|
||||
@@ -83,7 +83,7 @@ def get_pdf_imgs(generators):
|
||||
elif isinstance(generator, PagesGenerator):
|
||||
for page in generator.pages:
|
||||
process_content(page)
|
||||
|
||||
|
||||
|
||||
def convert_pdfs(pelican):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user