-
-
Notifications
You must be signed in to change notification settings - Fork 334
Fix validation of self-closing tag followed by text #201
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
Conversation
bd0de67
to
c7a0cad
Compare
Thanks for raising this PR. LEt me go through the changes. |
c37122e
to
e845e02
Compare
Added another test. Would you prefer that on this case the error would be "Tag in/valid is an invalid name"? |
spec/validator_spec.js
Outdated
|
||
it("should not consider this as self-closing tag", function() { | ||
const xmlData = "<rootNode><in/valid></rootNode>"; | ||
const expected = {code: "InvalidAttr", msg: "attribute /valid has no space in starting."}; |
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.
Is this expected to be InvalidTag, and "Tag in/valid is an invalid name"? Or are you ok with this error?
e845e02
to
0aaee2d
Compare
I changed this to behave just like |
If there is no space before the closing tag, and the tag is followed by text, validation failed: <main><empty/>text</main>
0aaee2d
to
9d0f04a
Compare
expect(result).toEqual(expected); | ||
}); | ||
|
||
/* |
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.
This test is commented out because it doesn't pass due to another bug. This is addressed in #205
This fix is minor, so I reordered the commits to have it first. The other unicode PR now depends on this change. |
By inspiring your this fix, I've just pushed a commit. Please have a look and check if it solves the purpose of both PR. If not you can revise your PR. |
@orgads Do we need this PR anymore? |
If there is no space before the closing tag, and the tag is followed by text, validation failed:
Purpose / Goal
Type
Please mention the type of PR