Issue Bug Closed

#71821f:switch includes all content aside of the f:case subtags

Bernd Wilke 11/25/15, 11:30 updated 10/19/17, 22:00

Description

other than the f:if tag which renders only the subtags f:then and f:else (if they are used) the f:switch tags includes all content outside any f:case sub tags.
this results in a lot of whitespace if you just use some order in a switch. or all comments are included everytime:

example 1:

<f:if condition="{test}">
  // test is true
  <f:then>test is valid</f:then>

  // test is false
  <f:else>test is not valid</f:else>
</f:if>

assuming test is 2 the result will be:

test is valid

example 2:

<f:switch expression="{test}">
  // first case
  <f:case value="1"> test is 1</f:case>

  // second case
  <f:case value="2">test is 2</f:case>

  // others
  <f:case default="1">test is anything other</f:case>
</f:switch>

assuming test is 2 the result will be:

// first case

// second case
test is 2

// others

Reviews 1