Generated SVG without escaped comments

0 votes
asked Mar 17, 2021 in Question / help by krasa (820 points)
edited Apr 4, 2021 by krasa
IntelliJ user has a strange bug, probably JRE/environment related

https://github.com/esteinberg/plantuml4idea/issues/300

- the svg was generated without escaped hyphens "--". Batik is then not able to generate an image and throws the exception you can see there. Or rather Xerces is not able to parse the xml, no matter what, setIgnoringComments is useless

I was not able to reproduce it.

Perhaps a workaround would be to have an option to disable adding of comments at net.sourceforge.plantuml.svg.SvgGraphics#addComment.

Or I could solve it on my end via JSoup and strip the comments (that on the other hand causes "The entity "nbsp" was referenced, but not declared", so I would have to make my own JSoup).

.
commented Apr 21, 2021 by krasa (820 points)

@plantuml I have another invalid svg xml from China, but in a different way - there are additional tag attributes that breaks it:   

xmlns="" 

https://github.com/esteinberg/plantuml4idea/issues/304#issuecomment-823884351

commented Apr 22, 2021 by krasa (820 points)

So the problem is that javax.xml.transform.TransformerFactory.newInstance() returns net.sf.saxon.TransformerFactoryImpl because of another IntelliJ plugin. Not sure if it is possible to do something about it.

commented Apr 23, 2021 by krasa (820 points)

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...