1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-06 10:06:19 +00:00
TiddlyWiki5/editions/test/tiddlers/tests/data/conditionals/NestedElseif.tid
Jeremy Ruston b7562f0c7b
Conditional Shortcut Syntax (#7710)
* Initial Commit

* Update docs

* Add support for elseif blocks

* Another test

* WIP

* Change from `{%if%}` to `<%if%>`

See discussion here - https://talk.tiddlywiki.org/t/proposed-if-widget/7882/64

* Don't use the widget body as the template if a list-empty widget is present

See discussion here - https://github.com/Jermolene/TiddlyWiki5/pull/7710#issuecomment-1717193296

* List widget should search recursively for list-template and list-empty

* Allow block mode content within an if/then/else clause

* Update docs

* Add from-version tag to docs
2023-10-14 09:41:21 +01:00

60 lines
979 B
Plaintext

title: Conditionals/NestedElseif
description: Nested elseif conditional shortcut syntax
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Text
\whitespace trim
This is a&#32;
<% if [<something>match[one]] %>
<% if [<another>match[one]] %>
Indian
<% elseif [<another>match[two]] %>
African
<% else %>
Unknown
<% endif %>
&#32;Elephant
<% elseif [<something>match[two]] %>
Antelope
<% else %>
Crocodile
<% endif %>
, I think.
+
title: Output
<$let something="one" another="one">
{{Text}}
</$let>
<$let something="one" another="two">
{{Text}}
</$let>
<$let something="one" another="three">
{{Text}}
</$let>
<$let something="two">
{{Text}}
</$let>
<$let something="three">
{{Text}}
</$let>
+
title: ExpectedResult
<p>
This is a Indian Elephant, I think.
</p><p>
This is a African Elephant, I think.
</p><p>
This is a Unknown Elephant, I think.
</p><p>
This is a Antelope, I think.
</p><p>
This is a Crocodile, I think.
</p>