1

I would like to use Template parameters within syntaxhighlight. For instance, something like:

 <syntaxhighlight lang="scala">
 val x: Boolean = {{{xVal}}}
 val y: Boolean = {{{yVal}}} | x
 </syntaxhighlight>

Where xVal and yVal are the template parameters to be replaced. The content is multiline and may contain pipe characters, etc.

pgrandjean
  • 676
  • 1
  • 9
  • 19

2 Answers2

2

Use #tag:

{{#tag:syntaxhighlight|lang=scala|
val x: Boolean = {{{xVal}}}
val y: Boolean = {{{yVal}}} {{!}} x
}}
Tgr
  • 27,442
  • 12
  • 81
  • 118
1

now the content should be the second param, as follows:

{{#tag:syntaxhighlight|{{{code|}}}|lang=cpp|}}

for the question, it should be:

{{#tag:syntaxhighlight|
val x: Boolean = {{{xVal}}}
val y: Boolean = {{{yVal}}} {{!}} x
|lang=scala}}
Yichi Chen
  • 11
  • 2