Closed samuelhward closed 2 years ago
The problem is, as suggested, that the viewer you are using to view the SVG does not support the full SVG 1.1 specification. This means it is unable to process as text formatting, including line breaks.
What is your preferred solution, to remove the warning and show all the text without line breaks?
Hi, I was directed here from the draw.io feedback form.
What is your preferred solution, to remove the warning and show all the text without line breaks?
That would be my preferred solution, or even better to have this a user-editable option.
I'm also seeing my text getting replaced with ellipses if the container isn't large enough on svg export . This behavior seems to be new and I would like a way to disable it if possible, but I can make a separate issue for this if you'd like @davidjgraph
You can disable it, but your viewer still doesn't support the parts of the SVG 1.1 specification that we use to render text. Are you saying it's better to render it wrongly and not warn the user?
@davidjgraph No. If the warning is left on by default, but with instructions on how to remove it from the SVG export then the user can decide for themselves to accept unformatted text and disable the warning, or to move to a different viewer
OK, thanks, we'll look into that.
You can remove it by deleting the last
👍 Thanks a lot, I have been doing that as a workaround yes.
@davidjgraph No. If the warning is left on by default, but with instructions on how to remove it from the SVG export then the user can decide for themselves to accept unformatted text and disable the warning, or to move to a different viewer
I don't think this is the best solution yet but is a nice compromise - especially if an image might have a very very small unnoticeable error due to an invisible text box or something along those lines
What is the best solution?
What is the best solution?
I suppose as long as the error text is crop-out-able (and maybe includes information on how to remove the message?) then there is little to be done!
The logical solution here would be to leave a warning on the dialog, when a user chooses to export the file as an SVG and not inside the SVG itself.
The logical solution here would be to leave a warning on the dialog, when a user chooses to export the file as an SVG and not inside the SVG itself.
Yes I agree, this is a good solution.
I am not sure if this is the same issue or not. SVGs used to display a no support message in the place of formatted text and wrapped text. I prefer that to this approach where I have to manually identify the places where text is formatted and what not. The issue is not a big deal, but the issue lies in the lack of explanation. If the export window would at least trigger a message that this message means that former would save the effort and time of looking up the issue.
Edit: For context, I use the SVG format to document with MS Word. As such, I don't have the choice to move to a different viewer.
Edit 2: Found out it's the same issue. I just wish the message was clarified on export.
For anyone who wants to remove it easily, you can use this sed command:
sed -i 's/<text text-anchor="middle" font-size="10px" x="50%" y="100%">Viewer does not support full SVG 1.1<\/text>//gm' *.svg
Is there any update on this? Also would a non full SVG 1.1 viewer not display text at all or just have it be unformatted? I'm confused since IE doesn't display text yet a conversion we do from svgs, to pdfs does display the text and the warning.
It would be nice to keep the warning in mind but have a way to remove it in general, since its quite a big project and it would be janky to have people manually delete that every time.
We use draw.io as part of a document-production toolchain and it would be difficult for us to cleanly automate the removal here. Is it possible to have a CSS class on this SVG warning message, so we can hide it more easily via CSS? (or a command-line switch to not emit it).
The logical solution here would be to leave a warning on the dialog, when a user chooses to export the file as an SVG and not inside the SVG itself.
What warning would be shown? At the point of export you don't know what kind of viewer will be used to view the SVG. Telling the user there might be a problem will confuse people, plus they might not know what kind of a viewer will be used.
The CSS class can be done. I'm a bit concerned about complicating the dialog considering all modern browsers will render this correctly.
<switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://desk.draw.io/support/solutions/articles/16000042487" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Viewer does not support full SVG 1.1</text></a></switch>
Removing this element will have the effect you want, also.
The problem is, as suggested, that the viewer you are using to view the SVG does not support the full SVG 1.1 specification.
I'm more concerned in the features that draw.io is using that are not supported in other viewers.
draw.io uses foreignObjects with html inside to render text. That pretty much fails miserably in even non-web browser SVG viewer or editor, e.g., Inkscape, og embedding in MS Word.
Inkscape and other tools have dealt with this normally just using tspan to break up lines and apply styles. That is how text is supposed to be formatted in pure SVG.
Right now, I need to export SVG from draw.io, and run through a script to convert the html into tspans while removing the foreignObjects, and then open with Inkscape to fix positioning. Finally I can import into MS Word.
Did you try this? It requires manual line breaks, but uses tspan in the output. (Formatting is still available for the label as a whole.)
We'll add an URL parameter (svg-warning=0) to suppress the warning.
Hi, this solution only is a partly solution for the online version, not for the draw.io desktop export in general.
Diadvantages:
I think because of winword/Office 365 has a very large user base (also integrating it in illustrator...), it should be a general default setting in the editor (SVG compatibility mode). So everyone is able to work with draw.io and embed e.g. architecture diagrams in e.g. winword without this warning or loss of information. For UML the diagrams can live without this extended features.
So why not disable word wrap and the formatted text when this new "switch" and other incompatible features -> limit the editor for compatibility reasons.
I tried this workaraound: https://www.diagrams.net/doc/faq/svg-export-text-problems and it can not be achieved through your proposal with multi selection: I have to select each field type and disable word wrap. Some kind of very cumbersome.
Is there any update on this issue. It's still there (as of 18-01-2021)
What update were you looking for beyond the information in this thread?
sorry by bad
We cannot make it default at this point. We will however change the text tab to include the word wrap option even if cells are selected that do not support word wrapping. This makes it easier to select all and uncheck word wrap and formatted text for all selected cells.
Many mathematical figures and other images available on Wikipedia are in SVG format. Importing them in LibreOffice Writer to finish a collage presenting has never been an issue. Until the moment we try DrawIO. I came here expecting something. Surprisingly, this issue is not even OPEN but the problem still exists. Trick/workaround is annoying if you have to do this repeatedly.
Edit: have
<switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://desk.draw.io/support/solutions/articles/16000042487" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Viewer does not support full SVG 1.1</text></a></switch>
Removing this element will have the effect you want, also.
can confirm this. Just remove the part between the
This solution is the worst, DrawIO is basic tool to draw diagrams so the final result need always some kind of extra editing in SVG editors like Inkscape or Illustrator, and here I see that the exported SVG doesn't show formatted text because you wanted to use some HTML tags to make it easy for browsers but who shows SVGs on their websites ? None, what is the common workflow is to export it to SVG then embed it in PDF or print it, so the idea to support web rendering is not correct at all, the web is better with light png or jpeg formats.
What is the best solution?
https://inkscape.org/forums/other/inkscape-viewer-does-not-support-full-svg-11/
Please show us how to convert arbitary HTML (this isn't used only for word wrapping) in SVG in JavaScript.
Please show us how to convert arbitary HTML (this isn't used only for word wrapping) in SVG in JavaScript.
Your intent is keep users enclosed in DrawIO work space which is impossible because some complex editing features are not available in your software, and you blame other viewers and editors for not supporting some weird tags that no one is using. Why not fix the root of the problem and ditch those HTML tags and be compatible with software standards.
Please don't tell us what our intent is without asking us. I am happy to engage constructively, but please keep comments professional and within our code of conduct.
Export to SVG is not a core feature, we're not an SVG editing tool, we're a diagramming tool. There's no conspiracy here, it's simply not a case we considered in the original design of the underlying model.
We're not blaming anyone, we're simply saying that we use an optional part of the SVG 1.1 that many non-browsers do not implement. Yes, our design decision led to the position currently, but these things can happen without evil intent.
Why not fix the root of the problem and ditch those HTML tags
Imprecise suggestions are not constructive. You're effectively talking about a complete re-write of the label rendering with us building a full HTML rendering engine ourselves. That's just too much work, we'd be looking 1-2 person years, that's not realistic.
I've added https://github.com/jgraph/drawio/commit/1cddc59ec34f0e5521c694b931e6a220ab9dda2d to the README to indicate this is not an SVG editing app.
We've implemented a workaround in 16.2.4. The export to SVG dialog now has a text option dropdown:
No change exports as it does currently. Embed fonts does just that in case the viewer doesn't have the font installed. Convert labels to SVG send transmits the diagram to our servers, generates a PDF, then pipes that through Inkscape and returns the output SVG.
Note with this last option:
If you want this to use in Inkscape, you're better off just exporting to PDF and importing that to Inkscape.
I'll close this ticket now, if there are issues with this implementation, please open another ticket.
Will we implement native SVG text in the app and export that, no, never. If you need this beyond anything, fork the project and implement it.
I am converting the diagram to svg in batchmode via a script
cmd="drawio -x -f svg -o "+args['out']+"/"+pagecount+".svg -p"+pagecount+" "+args['in'].replace(/(\s)/g,"\\$1");
exec(cmd, (error, stdout, stderr) => {
Is the option to change text setting available on the commandline?
23.0.2 now replaces the warning text with a high-res image of the label, if embed images and embed fonts are ticked in the SVG export dialog.
Preflight Checklist
Describe the bug 'Viewer does not support full SVG 1.1' embedded in raw SVG source. For me this is rendered in projects such as overleaf:
or causes other issues which are known. The rest of the image has text which is rendered fine for me (well, there are the unwanted ellipses) - is there any way to automate removal of this error message?
draw.io version (In the Help->About menu of the draw.io editor):
12.7.2 on Windows, Chrome Version 78.0.3904.97 (Official Build) (32-bit)
Additional context
Raw SVG: