". The offending peice of my template is @for(signal <- signalsIn ++ signalsOut) { @(signal.name) => " /> ". The offending peice of my template is @for(signal <- signalsIn ++ signalsOut) { @(signal.name) => " /> ". The offending peice of my template is @for(signal <- signalsIn ++ signalsOut) { @(signal.name) => "/>

Escaping "=>" in twirl template

413 Views Asked by At

I have a twirl template containing the string "=>".

The offending peice of my template is

@for(signal <- signalsIn ++ signalsOut) {
    @(signal.name) => odw_@(signal.name),
  }clk => clk

Where the output I desire is something like

this_signal => odw_this_signal,
that_signal => odw_that_signal,
clk => clk

I get the "expected start of definition" error presumably because twirl is interpreting the "=>" as syntax.

2

There are 2 best solutions below

0
Ben Reynwar On BEST ANSWER

"=>" can be produced by @("=>")

0
biesior On

You can also just use HTML entity &gt; for > char:

@(signal.name) =&gt; odw_@(signal.name),