Skip to content

Commit

Permalink
Merge pull request #25 from szn/bugfix/24
Browse files Browse the repository at this point in the history
Bugfix/24
  • Loading branch information
szn committed Sep 10, 2024
2 parents 696d35d + 63fa1fc commit b5ed3fb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = confluence.md
version = 0.4.4
version = 0.4.5
author = Szymon Nieradka
description = Markdown to Confluence - upload any .md files to your Confluence cloud page
long_description = file: README.md
Expand Down
5 changes: 3 additions & 2 deletions src/md2cf/utils/confluencemd.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ def update_existing(self, page_id: str = None) -> int:
self.url = self.conf_url # to satisfy parent class

html = self.__rewrite_issues(html)
self.__attach_images(page_id, images)

if page_id is None:
logger.debug("Using `page_id` from `%s` file", self.md_file)
page_id = page_id_from_meta

self.__attach_images(page_id, images)

assert page_id, (
f"Can't update page without page_id given either by "
f"`--page_id` parameter or via `confluence-url` tag in `{self.md_file}` file"
Expand Down Expand Up @@ -259,6 +259,7 @@ def __attach_images(
) -> None:
"""Replaces <img> html tags with Confluence specific <ac:image> and uploads
images as attachements"""
logger.info("__attach_images %s", page_id)
for (_alt, path) in images:
rel_path = os.path.join(self.md_file_dir, path)
if not os.path.isfile(rel_path):
Expand Down
2 changes: 1 addition & 1 deletion src/md2cf/utils/md2html.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __rewrite_images(html: str,
rel_path = os.path.join(md_file_dir, path)
if not os.path.isfile(rel_path):
assert os.path.isfile(path), f"File `{path}` does not exist"
logger.warning("file `%s` does not exist, using file relative to "
logger.debug("File `%s` does not exist, using file relative to "
"current dir `%s`", rel_path, path)
rel_path = path

Expand Down

0 comments on commit b5ed3fb

Please sign in to comment.