Sablon.Processor.Document.FieldHandlers.Conditional (sablon v0.4.4)

Copy Markdown View Source

Handles «value:if», «value:elsIf», «value:else» and «value:endIf» blocks.

Summary

Functions

Consumes the clauses of an if/elsIf/else chain.

Functions

consume_clauses(state, field)

Consumes the clauses of an if/elsIf/else chain.

Returns the conditional clauses, the else block (or nil) and the updated construction state. A custom conditional handler can call this and wrap the result in its own statement instead of Sablon.Statement.Condition.