-
Notifications
You must be signed in to change notification settings - Fork 455
Correctly parse comments in doctype declarations #5581
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
Correctly parse comments in doctype declarations #5581
Conversation
@@ -740,7 +740,7 @@ public String getPrefix() { | |||
} | |||
|
|||
Markers markers; | |||
List<Element> elements; | |||
List<Content> elements; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a slight worry here about deserialization, but I'm not on my laptop to check.. Pointing it out here for a more thorough review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Indeed, types
Element
andContent
seem unrelated (other than descending fromXml
). - But I agree, the external subsets shouldn't be modelled as a collection of elements. These are not elements from logical perspective.
- Having said that, I think we should go for it. As far as I understand,tThe failure scenario is that for some XML files which use these declarations, their LSTs will no longer match until re-built.
All in all - let's try.
Thanks a lot for the help here @jhl221123 ! I've tagged Greg for an additional review of the concern I posted above. |
Thank you so much for the contribution, @jhl221123. |
Something seems wrong here. Note that Xml.Element isn't a normal XML element. For that we have Xml.Tag. Perhaps it is meant to correspond to https://www.w3.org/TR/xml/#NT-elementdecl? AFAICT, we now no longer create any Xml.Element instances anywhere. That would mean that any recipes which operate on these or on owned objects would be broken now. Can we check this again? |
This reverts commit ebf4d2b.
Co-authored-by: Tim te Beek <tim@moderne.io>
What's changed?
This change updates the logic in
visitDoctypedecl
to correctly createXml.Comment
objects for comments found within a doctype's internal subset. All other markup, such as entity declarations, is parsed asXml.CharData
to preserve its raw text.What's your motivation?
Xml.Ident
#4930Checklist