我试图在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
有没有办法让我输入的内容显示出来?
答案 0 :(得分:30)
您可以在注释中使用三重回拨(“`”)来表示多行引号。如果要进行语法突出显示,还可以指定语言:
```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>
```