-
-
Notifications
You must be signed in to change notification settings - Fork 155
Description
I have the following issue with the default rendering:
name: some name
data:
key1: |
{{value1}}If I substitute it with a multi-line string using the default rendering syntax like above, then indentation level is lost and the resulting yaml is invalid:
substitution_string: Line1\nLine2\nLine3
name: some name
data:
key1: |
Line1
Line2
Line3What I need per default is:
name: some name
data:
key1: |
Line1
Line2
Line3I have tried out to register a partial because then the indentation level is kept and the rendering is fine. But then I need a custom syntax for my users like {{> indent value1}} (assume here the partial is registered with name 'indent').
Is there a programmatic way in the handlebars-rs library to enable to keep indentation level before rendering and disable it afterwars? I need it for one field and I need to change the default behavior.
What I have tried out: Register a template with is_partial = true, but the member and the Template::compile2 to define TemplateOptions is also private.
Is there any way to keep indentation level with the default syntax without defining special helpers or custom syntax?