I'm currently documenting my C# code and would find it useful to include a code block that directly shows how a piece of code should be called. I use the <code>
tag that is embedded into the summary:
While this works in general, I would like to preserve white space (line breaks, indentation). I tried the following so far:
- I applied the
xml:space="preserve"
attribute to the<code>
tag, but this had no effect at all. - I used
<br />
to indicate individual new lines (this works as of VS 2019), but I can't insert spaces or tabs. I tried to use 
(for space) and	
(for tab), but the popup wouldn't show those. - I tried to use a
CDATA
section, but the code in between wasn't shown at all.
Is there any way to preserve white space in code tags of C# XML comments? Thank you for your help in advance.
tag half worked for me but it doesn't preserve tabs, To do that, I had to add a
tag before my tabs. – Display name Jul 29 '22 at 04:58