reflex-dev / reflex

🕸️ Web apps in pure Python 🐍

Home Page:https://reflex.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[REF-2625] Use rx.markdown to render mermaid diagrams

picklelo opened this issue · comments

Discussed in https://github.com/orgs/reflex-dev/discussions/3125

Originally posted by hragbalian April 20, 2024
Hi there,

I would like to be able to add mermaid diagrams to my markdown but the rx.markdown doesn't render it.

For example, the following code:

```mermaid
    graph TD
        A[Start] -->|Get books| B[Go to library]
        B --> C{Books available?}
        C -->|Yes| D[Borrow books]
        C -->|No| E[Reserve books]
        D --> F[Read books]
        E --> F
        F --> G[Return books]
        G --> H[Finish]

should yield:

    graph TD
        A[Start] -->|Get books| B[Go to library]
        B --> C{Books available?}
        C -->|Yes| D[Borrow books]
        C -->|No| E[Reserve books]
        D --> F[Read books]
        E --> F
        F --> G[Return books]
        G --> H[Finish]

but instead it's rendering as

image

Thanks!

From SyncLinear.com | REF-2625