Kashia asked:

What are those funny interpolation operators

Tags: nitro 0.29

Like:

  • #{..}
  • #|..|
  • #(..)
  • #/../ (?)

(1 attempts)

Kashia answered:

Apart from #{}, the standard ruby interpolator, Nitro understands two more interpolators:

  • #|..| is equivalent to #{markup(..)}
  • #(..) is equivalent to #{sanitize(..)}

You can customize both these methods as you need. And as always Nitro makes it easy to define your own ‘macros’.

You can extends Nitro::Markup.transform(text) to add operators or change the behaviour of the existents.

By VikingTux (contact me to claim answer)

Rating: 4