how do I correctly paste multi-line xml snippet to github wiki when using markdown
GithubMarkdownGithub Problem Overview
I am trying to create a github wiki for my project. But I am unable to format a snippet from a Spring beans xml file, into this wiki. What is the proper way to do it? I tried using pre
tag, code
tag, the multiline code tag etc. But either it is not getting displayed at all or It displays everything in the same line.
Github Solutions
Solution 1 - Github
not 100% sure if this is the same thing or not, but I just setup some xml snippets in my readme.md and used the
<myxml>
<someElement />
</myxml>
notation.
Solution 2 - Github
Replace all the less-than <
and greater-than >
symbols with <
and >
respectively, then wrap in <pre>
and <code>
as before.
Solution 3 - Github
An old question, however, the solution has changed in the interim. Simply use the ```xml tag on modern mark-down implementations.
```xml
<your XML here>
.```
Example:
<one>
<two>
</two>
</one>
It's that simple and it works far better than embedding the XML as described above.