Docs: fixes typos in conditonal shortcut syntax docs (#7872)

* Docs: Conditional Shortcut Syntax corrections

* Update Conditional Shortcut Syntax.tid

Add a link to Filter Expression tiddler
This commit is contained in:
Saq Imtiaz 2023-12-04 09:53:24 +01:00 committed by GitHub
parent 155db0f6f8
commit 2b0675cac5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -4,14 +4,14 @@ tags: WikiText
title: Conditional Shortcut Syntax
type: text/vnd.tiddlywiki
<<.from-version "5.3.2">> The conditional shortcut syntax provides a convenient way to express if-then-else logic within WikiText. It evaluates a filter and considers the condition to be true if there is at least one result (regardless of the value of that result).
<<.from-version "5.3.2">> The conditional shortcut syntax provides a convenient way to express if-then-else logic within WikiText. It evaluates a [[filter expression|Filter Expression]] and considers the condition to be true if there is at least one result (regardless of the value of that result).
Within an "if" or "elseif" clause, the variable `condition` contains the value of the first result of evaluating the filter condition.
A simple example:
<$macrocall $name='wikitext-example-without-html'
src='<% if [{$:/$:/info/url/protocol}match[file:]] %>
src='<% if [{$:/info/url/protocol}match[file:]] %>
Loaded from a file URI
<% else %>
Not loaded from a file URI
@ -21,11 +21,11 @@ src='<% if [{$:/$:/info/url/protocol}match[file:]] %>
One or more `<% elseif %>` clauses may be included before the `<% else %>` clause:
<$macrocall $name='wikitext-example-without-html'
src='<% if [{$:/$:/info/url/protocol}match[file:]] %>
src='<% if [{$:/info/url/protocol}match[file:]] %>
Loaded from a file URI
<% elseif [{$:/$:/info/url/protocol}match[https:]] %>
<% elseif [{$:/info/url/protocol}match[https:]] %>
Loaded from an HTTPS URI
<% elseif [{$:/$:/info/url/protocol}match[http:]] %>
<% elseif [{$:/info/url/protocol}match[http:]] %>
Loaded from an HTTP URI
<% else %>
Loaded from an unknown protocol