bodoni / svg

Composer and parser for SVG
Other
299 stars 45 forks source link

Support retrieving content of Event::Comment and Event::Instruction #42

Closed ssokolow closed 1 year ago

ssokolow commented 3 years ago

While experimenting with this, I noticed that's no way to construct a complete representation of the content of the parsed SVG file, because the contents of comments and processing instructions are inaccessible.

In fact, in the latter case, one could argue that it's a spec violation to not give the application access to the processing instructions, because SVG is XML-based and this is what the XML spec has to say about it:

"Processing instructions (PIs) allow documents to contain instructions for applications. PIs are not part of the character data of the document, but MUST be passed through to the application.

IvanUkhov commented 3 years ago

Thank you for the feedback! Yes, of course, this should be possible. It is not present simply because I wrote the package for a use case, and that use case did not require this functionality. Please feel free to enable.

IvanUkhov commented 1 year ago

The content of comments and instructions is exposed starting from 0.12.0.