For many years, one could use the <code/>
element for all kinds of fixed format text as documented here. The documentation specifically mentions "multiple lines of code" and examples (like this one) are showing how this used to work for multi-line code examples.
However, recent versions of Visual Studio (2017, 2019) started to format the content of <code/>
as freely flowing text, ignoring any line breaks. (If the element is in a class summary, the effect can be seen when hovering over the class name.)
So, suppose I have to put an XML snippet into the codedoc. I need newlines to be preserved, ideally without having to mark them with <br/>
, so that they can be easily copy and pasted in and out.
How can I do that?