I have @helper abc() {} in my template. When I parse my template with RazorLight, I got this message:
"The helper directive is not supported."
Yes, it's not supported and there is no plan to support it in the nearest future
@toddams Is there any way to work around that? I'm happy to help if a PR is needed
bumped into this today. I found this workaround:
@{
Func<int, int, IHtmlContent> PrintNumbers = (actual, assumed) =>
new Func<object, IHtmlContent>(@<text>
@((actual + assumed).EmptyIfZero())
@if (assumed > 0)
{
<span class="--assumed">(@assumed found)</span>
}
</text>)(null);
}
and then use it as in good old times:
<td>@PrintNumbers(12,4)</td>
@avs099 Thanks. Perhaps we should add this the FAQ.
Most helpful comment
bumped into this today. I found this workaround:
and then use it as in good old times:
<td>@PrintNumbers(12,4)</td>