mermaid.cli icon indicating copy to clipboard operation
mermaid.cli copied to clipboard

Background option doesn't work with svg

Open Jmuccigr opened this issue 6 years ago • 2 comments

the -b <color> option works fine with png and pdf, but not with svg where the output always has a white background.

Version 0.5.1 on a Mac 10.13.5

Jmuccigr avatar Jul 16 '18 18:07 Jmuccigr

Same behavior on linux inside docker (alekzonder/puppeteer)

ghost avatar Jul 27 '18 06:07 ghost

Old version

You made the same mistake as probably many others. I also just took the install command from the npm site which is as outdated as the outdated old repo.

Install from the new repo:

Either:

yarn add @mermaid-js/mermaid-cli
./node_modules/.bin/mmdc -h

Or use NPM:

npm install @mermaid-js/mermaid-cli
./node_modules/.bin/mmdc -h

Then your version will be @mermaid-js/[email protected] (at the time of writing), and not 0.5.1.

Issue with the background in svg exports still there

I checked it:

node_modules/.bin/mmdc -i test.mmd -o overview2.png -w 2048 -H 768 -b '#FFF000'

gives me a yellow background, but

node_modules/.bin/mmdc -i test.mmd -o overview2.svg -w 2048 -H 768 -b '#FFF000'

does not. The issue is still open.

lorenzznerol avatar Jan 03 '22 21:01 lorenzznerol

Development has moved to the https://github.com/mermaid-js/mermaid-cli repo, please re-open your issue there if it's still relevant. The package has also been renamed on NPM to @mermaid-js/mermaid-cli, so you may need to run npm uninstall mermaid.cli && npm install @mermaid-js/mermaid-cli to get the latest version of this package.

I believe this has been fixed by https://github.com/mermaid-js/mermaid-cli/pull/214 in @mermaid-js/mermaid-cli.

aloisklink avatar Jul 21 '23 22:07 aloisklink