Sergey Khmelevskoy
Sergey Khmelevskoy

Reputation: 2544

XML content inside pug template

Im trying to insert some xml code as code snippet visible on front-end, how can I esape pug parsing the content below xmp tag and just show show plain xml code without any processing ?

                  .backoffice__settings__yellow-bg.mt20
                    .xml-code
                      code
                        xmp
                          <?xml version=«1.0» encoding=«UTF-8» ?>
                          <OrdersList>
                            <SendOrder date=«1486019811» nomber=«63723» price_sum=«6940» weight_sum=«800»>
                              <UserInfo>
                                <family>Name</family>
                                <name> Name </name>
                                <patronymic> Name </patronymic>
                                <phone>79251111111</phone>
                                <email>[email protected]</email>
                              </UserInfo>
                              <Delivery>
                                <transport_companies>4</transport_companies>
                                <city_id>0a7e138b-7c55-4745-8a75-0441df4d3432</city_id>
                                <delivery_points_id>900305</delivery_points_id>
                                <price_delivery>400</price_delivery>
                              </Delivery>
                              <Commentary></Commentary>
                              <Items>
                                <Item article_product=«00122000» title=«Сноубордический рюкзак DAKINE HELI PRO 20L BOZEMAN» count=«1» price=«6940»/>
                              </Items>
                            </SendOrder>
                          </OrdersList>

The visual Im trying to achive

enter image description here

Upvotes: 1

Views: 997

Answers (1)

Shea Hunter Belsky
Shea Hunter Belsky

Reputation: 3218

Adding a period after the end of the tag declaration will embed the child text plainly (without evaluating it). You want to add a period to the xmp tag.

.backoffice__settings__yellow-bg.mt20
  .xml-code
    code
      xmp.
        <?xml version=«1.0» encoding=«UTF-8» ?>
        <OrdersList>
          <SendOrder date=«1486019811» nomber=«63723» price_sum=«6940» weight_sum=«800»>
            <UserInfo>
              <family>name</family>
              <name> name </name>
              <patronymic> name </patronymic>
              <phone>7925111111</phone>
              <email>[email protected]</email>
            </UserInfo>
            <Delivery>
              <transport_companies>4</transport_companies>
              <city_id>0a7e138b-7c55-4745-8a75-0441df4d3432</city_id>
              <delivery_points_id>900305</delivery_points_id>
              <price_delivery>400</price_delivery>
            </Delivery>
            <Commentary></Commentary>
            <Items>
              <Item article_product=«00122000» title=«Сноубордический рюкзак DAKINE HELI PRO 20L BOZEMAN» count=«1» price=«6940»/>
            </Items>
          </SendOrder>
        </OrdersList>

http://codepen.io/shbelsky/pen/ryXVxr?editors=1000

Upvotes: 1

Related Questions