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):
diff --git a/src/md2cf/utils/md2html.py b/src/md2cf/utils/md2html.py
index 6c606bd..96f0c8f 100644
--- a/src/md2cf/utils/md2html.py
+++ b/src/md2cf/utils/md2html.py
@@ -38,6 +38,7 @@ def md_to_html(md_file: str,
md_file_dir = os.path.dirname(md_file)
html = __rewrite_images(html, md_file_dir, images)
+ html = __fix_code_blocks(html)
return html, page_id_from_meta, url, images
def __parse_confluence_url(meta: Dict[str, str]) -> Tuple[Optional[str], Optional[str]]:
@@ -100,6 +101,13 @@ def __rewrite_images(html: str,
logger.warning("image tag `%s` not found in html", old)
return html
+def __fix_code_blocks(html: str) -> str:
+ """
+ @TODO temporary fix for https://github.com/szn/confluence.md/issues/12
+ """
+ html = html.replace('', '')
+ return html.replace("
", "")
+
def __get_file_contents(file: str) -> str:
"""Return file contents"""
with open(file, "r", encoding="utf-8") as stream: