Skip to content

Conformance Examples 0.1.0 — Render: comments-elided

comment-only

A comment produces no output.

Template

{{! ignore me }}

Output


comment-with-surrounding-text

Text on both sides of a comment is preserved; the comment is elided.

Template

before {{! middle }} after

Output

before  after

empty-comment

A comment with an empty body still produces no output.

Template

{{!}}

Output


comment-never-renders-despite-key-collision

A comment body that happens to match context keys is still elided; comments never interpolate.

Template

x:>{{! comment }}<

Context

{
    "comment": 4,
    "! comment": 1,
    "!comment": 3
}

Output

x:><

multiline-comment-body-elided

A comment body spanning multiple lines is elided in full.

Template

a{{! one
two
three }}b

Output

ab

comment-body-with-brace-like-text

A comment closes at the first }} encountered; it does not scan for a balanced close. The body up to and including the first }} after {{! is elided, and any remaining brace-like text renders as ordinary literal text.

Template

x:>{{! a {{ x }} b }}<

Output

x:> b }}<

Source fixture: render/comments-elided.json