Closed dinya closed 7 years ago
Sorry but they work only with the PNG format, which is the only format that supports saving the source diagram embedded with the image. It is a "limitation" of the draw.io
editor.
Maybe I can do a workaround, a "double save" of the diagram in source and SVG format and then inject the source into the SVG so to be able to extract it again when an edit is required.
Stay tuned, I will try this weekend.
I've found that the draw.io editor supports saving in SVG with and embedded diagram source, so I'm happy to release this new version.
Add add .svg
extension diagram names and you are free to edit diagrams in SVG format.
Add add .svg extension diagram names and you are free to edit diagrams in SVG format.
I tried
{{drawio_dmsf(diagrams/test.svg)}}
and got Error 500 after page reload
Started GET "/projects/project1/wiki/Test" for 192.168.0.3 at 2017-04-12 08:15:27 +0500
Processing by WikiController#show as HTML
Parameters: {"project_id"=>"project1", "id"=>"Test"}
Current user: USER (id=5)
Rendered wiki/_content.html.erb (45.1ms)
Rendered wiki/show.html.erb within layouts/base (69.5ms)
Completed 500 Internal Server Error in 223ms (ActiveRecord: 32.9ms)
ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT):
44: <hr />
45: <% end %>
46:
47: <%= render(:partial => "wiki/content", :locals => {:content => @content}) %>
48:
49: <%= link_to_attachments @page %>
50:
app/views/wiki/show.html.erb:47:in `_app_views_wiki_show_html_erb__4095262023663339092_43080820'
plugins/redmine_wiki_extensions/lib/wiki_extensions_wiki_controller_patch.rb:51:in `render_with_wiki_extensions'
plugins/redmine_wiki_extensions/lib/wiki_extensions_wiki_controller_patch.rb:62:in `respond_to_with_wiki_extensions'
app/controllers/wiki_controller.rb:116:in `show'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'
But {{drawio_dmsf(diagrams/test)}}
and {{drawio_dmsf(diagrams/test.png)}}
works well and saves diagram as diagrams/test.png
.
BTW, {{drawio_dmsf(diagrams/test.SVG)}}
saves as diagrams/test.SVG
but with PNG content. I don't know if it matters for Windows users.
The extension must be in lowercase to be recognized as svg; I will add code to check the extension in a case-insensitive manner. Your error seems to be cause by an incorrect UTF-8 character, maybe I've use some character with a wrong encoding, I will recheck this afternoom. What's your platform, Windows? What Redmine installation you use, Bitnami, Docker, virtual machine or custom installation?
I use custom installation of Redmine 3.3.1 with phusion passenger under Ubuntu 14.04.5. Locale is UTF-8
I cannot reproduce your error; what plugins are you using? The backtrace seems reporting a problem with the redmine_wiki_extensions plugin, but it seems strange to me. Can you try to disable/remove the other plugins so to isolate where is the error?
@mikitex70,
I updated DMSF to 1.5.9-master (and other used plugins to fresh versions) and SVG output is working now.
But math doesn't not work correctly: `\sin^2 x`
is not rendered as math and is `\sin^2 x`
still. But it's rendered well in draw.io editor.
{{mj (\sin^2 x) }}
(redmine_latex_mathjax plugin) doesn't working too.
Have you tried to export the diagram in SVG format directly from the editor and open it directly with a browser? Maybe the SVG format can't handle math without additional libriaries. I' will search if it needs to include something, maybe a Javascript library.
@mikitex70
Have you tried to export the diagram in SVG format directly from the editor and open it directly with a browser?
this way doesn't render LaTeX in proper way too.
So the problem seems to be related to the SVG format. In the weekend I will do some test to see if using some Javascript library may overcome to the problem. But maybe a Javascript library can solve the problem only if the SVG is embedded in a web page.
Try the new version from the develop
branch: now it renders the math expressions in SVG diagrams.
Tested with Firefox; with Chrome I've some trouble, sometimes is working and sometimes not.
Please, note that https://www.mathjax.org/cdn-shutting-down/
Already noted, changed the plug-in but the sources are not yet pushed. Maybe this weekend I will release the new version.
Tested with last Chrome, Firefox, Yandex under Windows 7 64 bit.
All works fine. Cann't note any troubles.
Very thanks for the great tool!
Is it possible to add option to
drawio_attach
anddrawio_dmsf
macroses to save image as SVG?It will be useful to copy text from diagram or for adding URL to nodes.