Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Simplify
titleEngine Compatibility

The Node Pico Engine supports the beesting operator in extended quotes, and does not suffer from the parser limitation on expressions using the right curly brace, }, in the expression.

KRL extended quotes support the beesting operator, making them simple templating systems. Inside an extended quote, expression values can be referenced using the #{<expr>} syntax. For example, suppose you've stored 10 and 20 in the variables a and b:

Code Block
somevar = <<
The average of #{a} and #{b} is #{(a+ b)/2}


titleNon-Scalar Values

You cannot If you try to insert non-scalar values into a string using the beesting syntax, only their types will be printed. For a non-scalarsscalar, use the encode() operator on the value first to turn it into a string.


Because of a limitation in the parser, you cannot use expressions that contain a right curly brace, }, inside a beesting. The parser simply finds the first right curly brace after the start of the beesting and considers that the end. So, for example, you cannot do this

somevar = <<
This is my first name: #{name{first}}