Skip to content

Missing code Blocks #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
martinschweingruber opened this issue Sep 12, 2024 · 1 comment
Open

Missing code Blocks #33

martinschweingruber opened this issue Sep 12, 2024 · 1 comment

Comments

@martinschweingruber
Copy link

Love the tool, it saved me a lot copying!

Issue:
The exports are missing code blocks (already in the html)

Some Investigation;
If we change getting the page to "body.view" (this gets the rendered html instead of the internal xml). We get the codeblocks, but it breaks other stuff, like links and title formating...

diff --git a/confluence-markdown-export.py b/confluence-markdown-export.py
index 036ea90..ddcabd4 100644
--- a/confluence-markdown-export.py
+++ b/confluence-markdown-export.py
@@ -44,14 +44,14 @@ class Exporter:
             # this could theoretically happen if Page IDs are not unique or there is a circle
             raise ExportException("Duplicate Page ID Found!")
 
-        page = self.__confluence.get_page_by_id(src_id, expand="body.storage")
+        page = self.__confluence.get_page_by_id(src_id, expand="body.view")
         page_title = page["title"]
         page_id = page["id"]
     
         # see if there are any children
         child_ids = self.__confluence.get_child_id_list(page_id)
     
-        content = page["body"]["storage"]["value"]
+        content = page["body"]["view"]["value"]
 
         # save all files as .html for now, we will convert them later
         extension = ".html"
@Spenhouet
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants