问题:如何在 github 评论中发布原始 XML

我正在尝试在 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

有没有办法让我输入的内容显示出来?

解答

您可以在注释中使用三重反引号 (```) 来多行引用代码。如果你想要语法高亮,你也可以指定语言:

```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>



Logo

ModelScope旨在打造下一代开源的模型即服务共享平台,为泛AI开发者提供灵活、易用、低成本的一站式模型服务产品,让模型应用更简单!

更多推荐