Skip to content
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

Unable to export mermaid diagrams as images in PDF format #699

Open
lldxflwb opened this issue May 15, 2023 · 0 comments
Open

Unable to export mermaid diagrams as images in PDF format #699

lldxflwb opened this issue May 15, 2023 · 0 comments

Comments

@lldxflwb
Copy link

lldxflwb commented May 15, 2023

Markdown Preview Enhanced (MPE) allows users to preview classDiagram using mermaid code blocks and export them as HTML successfully. However, when the users try to export the diagrams as PDF files, they only get the code and not the corresponding image. For instance, the following mermaid code:

classDiagram
    class GetBodyInterface
    class DealEveryItemBody
    class DealAllItemFromTotal
    class DealAllItemFromTotalAssignPort
    class DealSubIitem
    class GetDataByDate
    class DealSubItemInfo
    class DealSubItemMergeInfo
    class GetDataFromXXXBox
    class DealEveryItemBodyPost
    class DealXXXXXXNEW
    class DealXXXIDnew 
    class DealXXXXXXNEW
    class GetYYYNEW 
    class GetDataByDateFromHtml
    DealEveryItemBody --|> GetBodyInterface
    DealAllItemFromTotal --|> DealEveryItemBody
    DealAllItemFromTotalAssignPort --|> DealAllItemFromTotal
    DealSubIitem --|> DealAllItemFromTotal
    GetDataByDate --|> DealAllItemFromTotal
    DealSubItemInfo --|> DealAllItemFromTotal
    DealSubItemMergeInfo --|> DealAllItemFromTotal
    GetDataFromXXXBox--|> DealEveryItemBody
    DealEveryItemBodyPost --|> DealEveryItemBody
    DealXXXXXXNEW --|> DealEveryItemBody
    DealXXXIDnew --|> DealXXXXXXNEW
    GetYYYNEW --|> GetDataFromXXXBox
    GetXXXNEW --|> GetDataFromXXXBox
    GetDataByDateFromHtml --|> GetDataByDate

When exported as PDF, it appears as plaintext and not as an image.

Expected Behavior: The users should be able to export mermaid diagrams as images in PDF format when using MPE.

Steps to Reproduce:

  1. Create a new markdown file in MPE.
  2. Insert a mermaid code block with classDiagram.
  3. Export the file as PDF.
  4. Observe that the diagram appears as plaintext instead of an image.
    Issue Title: Unable to export mermaid diagrams as images in PDF format

Possible Solution: Provide an option to export mermaid diagrams as images in PDF format.

Environment:

  • Operating System: [win11]
  • MPE Version: [v0.6.8]
    Possible Solution: Provide an option to export mermaid diagrams as images in PDF format.
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

1 participant