Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using switches to output named links doesn't work. #2

Open
williamjcm opened this issue Oct 9, 2024 · 3 comments
Open

Using switches to output named links doesn't work. #2

williamjcm opened this issue Oct 9, 2024 · 3 comments

Comments

@williamjcm
Copy link

As I was working on setting up WST for my wiki, I wanted to use a ParserFunctions switch in one template to generate named links based on the value passed to the template, like this:

{{#switch: {{{1}}}
 | case1 = [[:page1|Page 1]]
 | case2 = [[:page2|Page 2]]
 | unknown value
#}}

However, links get rendered as if I wrapped them in <nowiki>/</nowiki>. Is there any workaround, or is this plugin just unsuitable for my use case ?

@nerun
Copy link
Owner

nerun commented Oct 9, 2024

Try escape sequences, as explained here:

  • use &&num;123; for {
  • use &&num;125; for }

So {{{1}}} must be: &&num;123;&&num;123;&&num;123; 1 &&num;125;&&num;125;&&num;125;

@williamjcm
Copy link
Author

The documentation doesn't mention that part, though, and states WST arguments can be used as-is, without escaping the curly braces.

@nerun
Copy link
Owner

nerun commented Oct 9, 2024

True, forgot that.

To be honest, i don't use DokuWiki anymore, so i don't remember many things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants