Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mkdocs_with_pdf/drivers/relaxedjs.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ def write_pdf(self, html_string: str, output: str):
self._logger.info(f" {log}")
if proc.poll() is not None:
break
# workaround for '--build-once' not working
if log.find("Now idle and waiting for file changes") > -1:
proc.kill()
break
7 changes: 6 additions & 1 deletion mkdocs_with_pdf/utils/image_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ def fix_image_alignment(soup: PageElement, logger: Logger = None):
if img.has_attr('class') and 'twemoji' in img['class']:
continue

styles = _parse_style(getattr(img, 'style', ''))
if not (img.has_attr('align')
or img.has_attr('width')
or img.has_attr('height')):
continue

styles = _parse_style(img.get('style', ''))

logger.debug(f' | {img}')
if img.has_attr('align'):
Expand Down