2013-05-08 57 views
8

我正在嘗試在github評論中顯示一些原始xml,並且如果我可以讓它顯示出來,我就會發現其中的bug。 當我粘貼並保存時,標記是解釋和我只得到內容。但評論意在表明需要發送給第三方應用程序的內容。如何在github評論中發佈原始XML

這是我想要插入的評論。

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento"> 
    <soapenv:Header/> 
    <soapenv:Body> 
     <urn:catalogCategoryTree soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
     <sessionId xsi:type="xsd:string" xs:type="type:string" xmlns:xs="http://www.w3.org/2000/XMLSchema-instance">blablaa</sessionId> 
     <parentId xsi:type="xsd:string" xs:type="type:string" xmlns:xs="http://www.w3.org/2000/XMLSchema-instance">?</parentId> 
     <storeView xsi:type="xsd:string" xs:type="type:string" xmlns:xs="http://www.w3.org/2000/XMLSchema-instance">?</storeView> 
     </urn:catalogCategoryTree> 
    </soapenv:Body> 
</soapenv:Envelope> 

這裏就是被呈現給我的同事

soapenv:Header/ 
soapenv:Body 

blablaa 
? 
? 
/urn:catalogCategoryTree 
/soapenv:Body 
/soapenv:Envelope 

有沒有辦法讓我的型秀嗎?

回答

26

您可以在註釋中使用三重反勾號(```)多行引用代碼。如果你想語法高亮,你也可以指定語言:

```xml 
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento"> 
    <soapenv:Header/ 
    <soapenv:Body> 
     <urn:catalogCategoryTreevsoapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
      <sessionId xsi:type="xsd:string" xs:type="type:string" xmlns:xs="http://www.w3.org/2000/XMLSchema-instance">blablaa</sessionId> 
      <parentId xsi:type="xsd:string" xs:type="type:string" xmlns:xs="http://www.w3.org/2000/XMLSchema-instance">?</parentId> 
      <storeView xsi:type="xsd:string" xs:type="type:string" xmlns:xs="http://www.w3.org/2000/XMLSchema-instance">?</storeView> 
     </urn:catalogCategoryTree> 
    </soapenv:Body> 
</soapenv:Envelope> 
``` 
+0

感謝那個 – baash05 2013-05-15 02:51:10

+0

謝謝,我跑進那問題'「‘’」不起作用。它需要單獨的「'」。 – 2014-07-28 13:30:20