Skip to content

Conversation

@svallebro
Copy link

Changed the way whitespaces are removed. To keep multiline values.

if (node.NodeType == XmlNodeType.Text)
return Regex.Replace(((XText)node).Value.Replace('\n', ' '), @"\s+", " ");

return Regex.Replace(((XText)node).Value.Replace(@" ", ""), @"^\n|[S*|\n]$","",RegexOptions.Multiline);
Copy link
Owner

@Pxtl Pxtl Mar 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that you're fixing this bug... but I'm not getting why you're searching for 13 spaces. Also, shouldn't you use <para> tags if you want linebreaks in your xml comments reflected into the Markdown?

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/xmldoc/para

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had not read about the tag seems like a nice thing to use.

The reason why I used replaced 12 with empty string was that it was the simplest resolution I could come up with to remove the first whitespaces that XML generator added just for structure.

I did not spend much time on this. I just wanted to share the change I needed to make it look more readable in multiline summary comments that I created in the class diagram tool.

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.

2 participants