Skip to content

Enforced strict error on malformed self-closing tag.#110

Open
springcomp wants to merge 4 commits into
mhutch:mainfrom
springcomp:fix/malformed-self-closing-tag
Open

Enforced strict error on malformed self-closing tag.#110
springcomp wants to merge 4 commits into
mhutch:mainfrom
springcomp:fix/malformed-self-closing-tag

Conversation

@springcomp
Copy link
Copy Markdown
Contributor

Fixes #109.

This pull request ensures that malformed self-closing tags are reported.

To solve this issue, the XmlTagState handler looks into the context.Statetag value MAYBE_SELF_CLOSING.
In that case, no other characters than > are accepted.

I noticed that the current code has the same value for two different state tags.
Essentially, I changed the assignments like thus:

		const int ATTEMPT_RECOVERY = 1;
		const int RECOVERY_FOUND_WHITESPACE = 2;
-		const int MAYBE_SELF_CLOSING = 2;
+		const int MAYBE_SELF_CLOSING = 3;
		const int FREE = 0;

I’m not sure what other impacts this has on the code, but all unit-tests are green, so 🤷.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider enforcing strict compliance when parsing malformed self-closing tags

1 participant