template-archive icon indicating copy to clipboard operation
template-archive copied to clipboard

Allow switch statements in TemplateMark

Open OliverTod opened this issue 3 years ago • 3 comments

This issue extends #588.

Requested functionality: Extend TemplateMark so that more complex conditional statements can be used in a bidirectional way. That is, so that users can draft and parse with greater flexibility. This could be done by allowing switch statements.

Switch statements For example, in JavaScript a switch statement is written as:

switch(colourVariable){
  case "yellow":
  ...
  break

  case "red":
  ...
  break

  case "blue":
  ...
  break

  default:
  ...
  break
}

Maybe this could be written as: {{#switch colourVariable}}{{#case yellow}} ... {{#case red}} ... {{#case blue }} ... {{#default}} ... {{/switch}}

OliverTod avatar Nov 24 '21 05:11 OliverTod

Hi! I would like to work on this feature. Can you please guide me how to get started?

Bl4ck-h00d avatar Dec 28 '21 11:12 Bl4ck-h00d

Hello, I would like to work on this, can you please guide me on how to get started!

aryanshukla7 avatar Jan 26 '22 12:01 aryanshukla7

@OliverTod @DianaLease Hello, I would like to work on this, can you please assigned me this issues

alsoarpit avatar Feb 01 '22 05:02 alsoarpit