Abe
Abe

Reputation: 9031

how do I correctly paste multi-line xml snippet to github wiki when using markdown

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.

Upvotes: 111

Views: 77996

Answers (3)

sagneta
sagneta

Reputation: 1701

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.

Upvotes: 34

Jon
Jon

Reputation: 15200

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.

Upvotes: 245

Glim
Glim

Reputation: 211

Replace all the less-than < and greater-than > symbols with &lt; and &gt; respectively, then wrap in <pre> and <code> as before.

Upvotes: 21

Related Questions