Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVGReader - Unknown tag are not retrieved #41

Closed
thomas-kl1 opened this issue Jan 31, 2018 · 2 comments
Closed

SVGReader - Unknown tag are not retrieved #41

thomas-kl1 opened this issue Jan 31, 2018 · 2 comments
Labels
enhancement Improvement to an existing feature

Comments

@thomas-kl1
Copy link
Contributor

thomas-kl1 commented Jan 31, 2018

Actually I know it's not a bug, but a feature.

SVG\Reading\SVGReader::$nodeTypes contain the allowed node types. However I'd like to read a SVG and retrieve all properties, even if there not implemented. There's a lot of elements: SVG Elements and it should impossible to implement all (hard work).

Otherwise it seems that the SVGReader class apply all properties as attributes to the parsed node. I understand that declaring specific node types is require in order to render the SVG, but In don't think so to read a SVG.
So, if the SVGReader do not find any concret class for the current parsed node, it should instantiate a new object. In order to instantiate the right node (SVGNode or SVGNodeContainer generic implementations), should we had a full associative array of elements (as key) with boolean (as value) which defined if an element is a container or a final node?

If I'm totally wrong and it's not the purpose of the library, please tell me :)

@meyfa
Copy link
Owner

meyfa commented Jan 31, 2018

You are right, "unknown" nodes should not be discarded. I don't think differentiating between containers and non-containers is necessary — since we can never know for custom tags, it should always be an SVGNodeContainer.

@meyfa meyfa added the feature New feature or request label Jan 31, 2018
@meyfa meyfa added enhancement Improvement to an existing feature and removed feature New feature or request labels Mar 8, 2018
@meyfa meyfa closed this as completed in 5677a18 Mar 25, 2018
@meyfa
Copy link
Owner

meyfa commented Mar 25, 2018

This is now implemented in 5677a18. Nodes with an unknown tag name are retrieved in a generic implementation that supports everything supported by regular containers - i.e. attributes, styles, child nodes, and text content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants