-
Notifications
You must be signed in to change notification settings - Fork 62
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
Spaces between tags are treated as pcdata #330
Comments
We had a similar issue in HTML (I though it was in table). Some elements should have a special parsing mode to be white-space insensitive. We introduced it for appropriate HTML elements, so it's a matter of reusing that for the appropriate SVG elements. |
Thanks! I can see the discussion in #225. |
I'm not quite sure. @aantron , you probably have a bit more expertise there, do you have an opinion ? |
I don't have an opinion on this. All I can say is that for |
<insert appropriate swearing/> 🤦 I think we can probably gloss over that. @Mbodin I agree with your proposal, to ignore all whitespace for elements that don't accept pcdata. It might be worth glancing at the spec if something is specified in that regard, but otherwise, that will suffice. |
Is there a fix for this? It seems like pcdata should be allowed, especially for examples that use I have been unable to work with types like this which is unfortunate. |
@ncitron I think that the above-mentioned branch https://github.com/Mbodin/tyxml/tree/whitespace (PR #331) fixes the issue.
|
Consider the following OCaml file:
The content of the g tag is interpreted as a
[> `PCDATA ] Tyxml_svg.elt
which is incompatible with[< Svg_types.g_content ] Tyxml_svg.elt
, and I get a type error. In other words the space between the opening and closing of the g tag is interpreted as a pcdata. The same goes if I place a newline instead of the space.I'm surprised as the SVG specification itself uses a lot of spacing in its examples. For instance the following SVG is provided as a valid example in https://www.w3.org/TR/2003/REC-SVG11-20030114/struct.html#GroupsOverview despite having the same spacing between its g tags.
I don't know the SVG specification enough to state what is meant to be there: should text with only white spaces be ignored instead of being treated as pcdata?
The text was updated successfully, but these errors were encountered: