diff --git a/ICSharpCode.NRefactory.Tests/Documentation/CSharpDocumentationTests.cs b/ICSharpCode.NRefactory.Tests/Documentation/CSharpDocumentationTests.cs index 031c55554..b1060879a 100644 --- a/ICSharpCode.NRefactory.Tests/Documentation/CSharpDocumentationTests.cs +++ b/ICSharpCode.NRefactory.Tests/Documentation/CSharpDocumentationTests.cs @@ -169,5 +169,18 @@ public void DocumentationAboveAttributeInRegion() class Test { }"); Assert.AreEqual("", typeDefinition.Documentation.ToString()); } + + [Test] + public void CDATAInDocumentation() + { + Init(@"using System; +/// before]]>after +class Test { } +"); + var element = XmlDocumentationElement.Get(typeDefinition); + Assert.AreEqual(1, element.Children.Count()); + Assert.AreEqual("summary", element.Children[0].Name); + Assert.AreEqual("beforeafter", element.Children[0].TextContent); + } } } diff --git a/ICSharpCode.NRefactory.Xml/DocumentationElement.cs b/ICSharpCode.NRefactory.Xml/DocumentationElement.cs index 17d17e1f7..43e816b31 100644 --- a/ICSharpCode.NRefactory.Xml/DocumentationElement.cs +++ b/ICSharpCode.NRefactory.Xml/DocumentationElement.cs @@ -198,9 +198,13 @@ static List CreateElements(IEnumerable chil List list = new List(); foreach (var child in childObjects) { var childText = child as AXmlText; + var childTag = child as AXmlTag; var childElement = child as AXmlElement; if (childText != null) { list.Add(new XmlDocumentationElement(childText.Value, declaringEntity)); + } else if (childTag != null && childTag.IsCData) { + foreach (var text in childTag.Children.OfType()) + list.Add(new XmlDocumentationElement(text.Value, declaringEntity)); } else if (childElement != null) { if (nestingLevel < 5 && childElement.Name == "inheritdoc") { string cref = childElement.GetAttributeValue("cref");