diff options
author | Michael Hutchinson <m.j.hutchinson@gmail.com> | 2015-02-03 09:35:56 +0300 |
---|---|---|
committer | Michael Hutchinson <m.j.hutchinson@gmail.com> | 2015-02-03 23:29:46 +0300 |
commit | 1c1b2b82fdbdc61aeb2a346893d85c1eb7673eef (patch) | |
tree | c40dbc6a7fc422ce20b88489d558c12e8510d36d /main/src | |
parent | 946ae56dd9261798f743807f4a7a99de6340f914 (diff) |
[Xml] Allow whitespace in closing tag
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/addins/Xml/Parser/XmlClosingTagState.cs | 4 | ||||
-rw-r--r-- | main/src/addins/Xml/Tests/Parser/ParsingTests.cs | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/main/src/addins/Xml/Parser/XmlClosingTagState.cs b/main/src/addins/Xml/Parser/XmlClosingTagState.cs index 9510f77a6b..138c85a736 100644 --- a/main/src/addins/Xml/Parser/XmlClosingTagState.cs +++ b/main/src/addins/Xml/Parser/XmlClosingTagState.cs @@ -112,6 +112,10 @@ namespace MonoDevelop.Xml.Parser rollback = string.Empty; return Parent; } + + if (XmlChar.IsWhitespace (c)) { + return null; + } if (!ct.IsNamed && (char.IsLetter (c) || c == '_')) { rollback = string.Empty; diff --git a/main/src/addins/Xml/Tests/Parser/ParsingTests.cs b/main/src/addins/Xml/Tests/Parser/ParsingTests.cs index ad84140b7a..04d8f2275d 100644 --- a/main/src/addins/Xml/Tests/Parser/ParsingTests.cs +++ b/main/src/addins/Xml/Tests/Parser/ParsingTests.cs @@ -159,6 +159,17 @@ namespace MonoDevelop.Xml.Tests.Parser parser.AssertEmpty (); parser.AssertErrorCount (2); } + + + + [Test] + public void ClosingTagWithWhitespace () + { + var parser = new TestXmlParser (CreateRootState ()); + parser.Parse (@"<doc><a></ a></doc >"); + parser.AssertEmpty (); + parser.AssertErrorCount (0); + } [Test] public void Misc () |