I am using a plugin for Grav CMS in conjunction with symfony/twig to import a yaml file with the following contents:
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
I am creating an array and then using yaml_emit
to import the full YAML file:
{% autoescape 'html' %}
{{ arr2|yaml_emit}}
{% endautoescape %}
This works for the most part. However, on the web page, the imported file is rendered without the >-
block chomping indicator for the 'metadata' field, so it is rendered as:
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
How can I ensure the block chomping indicator is not removed?