This project has moved and is read-only. For the latest updates, please go here.
2
Vote

slash from end-of-tag is misparsed

description

For the following test code:
<test>
<ref attname=abc/>
</test>
If I examine attributes of ref tag, its attribute name is "attname" and value is "abc/". That slash should not get added to the value, since it belongs to the "/>" combo of chars.

comments

WardMD wrote Jan 15, 2016 at 6:56 PM

I believe this can be corrected with the following modification to the HtmlDocument.cs (Parse routine):
                case ParseState.AttributeValue:
                    if (NewCheck())
                        continue;

                    if (IsWhiteSpace(_c) || (_c == '/'))
                    {
                        PushAttributeValueEnd(_index - 1);
                        _state = ParseState.BetweenAttributes;
                        continue;
                    }

Regards,
Mark Ward
Carson, CA

wrote Jan 15, 2016 at 6:56 PM