can't restore the grapth from svg source code

0 votes
asked Apr 29 in Bug by seekerYb (120 points)

I use plantuml on the online demo server: http://www.plantuml.com/plantuml/uml/  version 1201905 

@startuml
class A 
A <|-- B
@enduml

this piece of plantuml code work well and can successfully generate a svg file. But when I want to edit the uml . I may open the source code of the svg file and find the origin plantuml code. In the end of the file the code would be like this:

@startuml
class A 
A <|- - B
@enduml

 

a redundant space appear between the two dashes´╝îwhich cause a syntax error. When the whole graph is complex, I must delete all the redundant space manually.I'm looking forward to your reply.

1 Answer

0 votes
answered Apr 29 by plantuml (198,780 points)
selected Apr 30 by seekerYb
 
Best answer
The main issue is that the diagram code is put into a svg comment. Separator for SVG comment are <!-- and --> so spaces are added to prevent clash between the diagram definition itself and the SVG comment separators.

We cannot do much about this. Any suggestion is welcome !
commented Apr 30 by albert (2,540 points)
I'm thinking about 2 possibilities:
- CDATA
- encode the XML special characters i.e. &, ", ', <, > by their escaped versions: &amp;, &quot;, &apos;, &lt;, &gt;  in the comment.
...