3

我正在使用 Grav CMS 的插件和 symfony/twig 来导入具有以下内容的 yaml 文件:

sp:
  xyzsp:
    description: ''
    issuer: https://ssotest.com
    relay_state: "/"
    login_url: https://ssotest.com
    logout_url: https://ssotest.com/access/logout
    slo_url: ''
    metadata: >-
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?><EntityDescriptor entityID="your_subdomain.com" xmlns="urn:oasis:names:tc:SAML:2.0:metadata"><SPSSODescriptor AuthnRequestsSigned="false" WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol"><NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</NameIDFormat><AssertionConsumerService index="1" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://accountname.com/access/saml"/></SPSSODescriptor></EntityDescriptor>
    sign_response: false
    sign_assertion: true
    encrypt_assertion: false
    profile:
      assertion: global
      nameid: global
      attribute: empty
      response: global
      signature: global

我正在创建一个数组,然后使用yaml_emit它来导入完整的 YAML 文件:

{% autoescape 'html' %}
{{ arr2|yaml_emit}}
{% endautoescape %}

这在大多数情况下都有效。但是,在网页上,导入的文件在渲染时没有>-“元数据”字段的块 chomping 指示符,因此它被渲染为:

sp:
  xyzsp:
    description: ''
    issuer: https://ssotest.com
    relay_state: /
    login_url: https://ssotest.com
    logout_url: https://ssotest.com/access/logout
    slo_url: ''
    metadata: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><EntityDescriptor entityID="your_subdomain.com" xmlns="urn:oasis:names:tc:SAML:2.0:metadata"><SPSSODescriptor AuthnRequestsSigned="false" WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol"><NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</NameIDFormat><AssertionConsumerService index="1" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://accountname.com/access/saml"/></SPSSODescriptor></EntityDescriptor>
    sign_response: false
    sign_assertion: true
    encrypt_assertion: false
    profile:
      assertion: global
      nameid: global
      attribute: empty
      response: global
      signature: global

如何确保不删除块咀嚼指示器?

4

0 回答 0