Skip to content

Conformance Examples 0.1.0 — Partials: trim-rendering

partial-trim-both-strips-surrounding-template-text

~ on both sides of a {{> key }} tag strips whitespace from the surrounding template text of the referencing template. The partial's own rendered content is untouched.

Template

before  {{~> who ~}}  after

Partials

who:

X

Output

beforeXafter

standalone-partial-strips-surrounding-template-text-without-tilde

A {{> key }} tag alone on its own line has the referencing template's surrounding indentation and newline stripped implicitly, with no ~ marker, and the captured indentation is re-applied to the partial's own rendered content (a single line here).

Template

before
  {{> who }}
after

Partials

who:

X

Output

before
  Xafter

Source fixture: partials/trim-rendering.json