Skip to content

Ability to escape curly braces in templates #784

@mattmazzola

Description

@mattmazzola

Describe the solution you'd like

I want to allow using literal braces in my templates.

This is example of the template I wanted to create

## [[{{author}}]] {{schema:@VideoObject:name}}
  - {{video {{url}}}}

This would make the output compatible with LogSeq video embeds {{video http://youtube.com/.... }}

This results in

Line 2: Missing closing '}}' for variable

I've tried

  • backslash escaping
    • like \{\{video {{url}}\}\} but this outputs the backslashes in the template
  • setting inline varables
{% set open = "{{" %} 
{% set close = "}}" %}
{{open}}video {{url}}{{close}}

Also errors

Line 3: Unclosed string - missing " before }}
Line 3: Malformed tag: expected '%}' but found '}'. Did you forget the '%'?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions