This is not a perfect matchup for what you intend to do but you can escape your markups with < for <, > for >, " for " (quotes), and also for (spaces).
So it will become something like this:
<code>
<DesktopHeader><br/>
<a href="/projects">Projects</a><br/> </DesktopHeader>
</code>
NOTE: Generally every character with an UTF-8 code above 127 is not interchangeable between the "normal" Western ISO-8859-1 encoding and UTF-8. But to creating HTML markups knowing these three (<, >, , and ") would be enough. I'm also found a link that can be useful for generating markups automatically.
codefor the component. Like it's done with Storybook JS.