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

Example export to SVG generates error #614

Closed
marceloboeira opened this issue Jan 5, 2018 · 7 comments
Closed

Example export to SVG generates error #614

marceloboeira opened this issue Jan 5, 2018 · 7 comments

Comments

@marceloboeira
Copy link

The page's example: Larger flowchart with some styling

graph TB
    sq[Square shape] --> ci((Circle shape))

    subgraph A subgraph
        od>Odd shape]-- Two line<br/>edge comment --> ro
        di{Diamond with <br/> line break} -.-> ro(Rounded<br>square<br>shape)
        di==>ro2(Rounded square shape)
    end

    %% Notice that no text in shape are added here instead that is appended further down
    e --> od3>Really long text with linebreak<br>in an Odd shape]

    %% Comments after double percent signs
    e((Inner / circle<br>and some odd <br>special characters)) --> f(,.?!+-*ز)

    cyr[Cyrillic]-->cyr2((Circle shape Начало));

     classDef green fill:#9f6,stroke:#333,stroke-width:2px;
     classDef orange fill:#f96,stroke:#333,stroke-width:4px;
     class sq,e green
     class di orange

If exported to SVG, it returns this as an error:

This page contains the following errors:
error on line 7 at column 4440: Opening and ending tag mismatch: br line 0 and div
Below is a rendering of the page up to the first error.
@tylerlong
Copy link
Collaborator

I confirmed this issue. And there is an easy fix: After you export the svg file, replace all <br> with <br/>.

@tylerlong
Copy link
Collaborator

tylerlong commented Mar 13, 2018

I have updated https://mermaidjs.github.io/mermaid-live-editor/. So if you download a SVG file there, <br>s are already replaced with <br/>s.

@tylerlong
Copy link
Collaborator

I also updated the mermaid file so it will auto convert <br> to <br/>.

@marceloboeira
Copy link
Author

@tylerlong thanks!

@cdrfun
Copy link

cdrfun commented Jun 22, 2018

@tylerlong I'm still getting the error and using <br/> wont't help. Here's the example from @marceloboeira

Error when opening the svg with current Chrome: error on line 352 at column 4922: Opening and ending tag mismatch: br line 0 and span

@Vidyut
Copy link

Vidyut commented Jan 15, 2019

I have mismatched tags br, line and div. The svg renders correctly in the editor, obviously, but the downloaded svg doesn't work. Strangely, selecting the correctly rendered svg in the browser and saving it also doesn't work.

@Aneurin
Copy link

Aneurin commented Jun 20, 2019

@tylerlong I'm still getting the error and using <br/> wont't help. Here's the example from @marceloboeira

Error when opening the svg with current Chrome: error on line 352 at column 4922: Opening and ending tag mismatch: br line 0 and span

Or see here for a minimal example. The "Download SVG" option always seems to convert <br/> to <br> so I guess something's regressed here. Opening the downloaded SVG in a text editor and manually converting back to <br/> fixes it as expected.

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

5 participants