Skip to content

Commit f42270a

Browse files
committed
Specify template bodies on ServiceStack Script Blocks
1 parent 8c3e13c commit f42270a

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/ServiceStack.Common/Script/Blocks/WhileScriptBlock.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace ServiceStack.Script
66
{
77
/// <summary>
88
/// while block
9-
/// Usages: {{#while b}} {{ false | to => b }} {{/while}}
9+
/// Usages: {{#while times > 0}} {{times}}. {{times - 1 | to => times}} {{/while}}
1010
/// {{#while b}} {{ false | to => b }} {{else}} {{b}} was false {{/while}}
1111
///
1212
/// Max Iterations = Context.Args[ScriptConstants.MaxQuota]

src/ServiceStack/ServiceStackScripts.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ public IRawString bundleHtml(object virtualPaths, object options)
598598
public class SvgScriptBlock : ScriptBlock
599599
{
600600
public override string Name => "svg";
601+
public override ScriptLanguage Body => ScriptTemplate.Language;
601602
public override async Task WriteAsync(ScriptScopeContext scope, PageBlockFragment block, CancellationToken token)
602603
{
603604
if (block.Argument.IsEmpty)
@@ -621,7 +622,8 @@ public override async Task WriteAsync(ScriptScopeContext scope, PageBlockFragmen
621622
public abstract class MinifyScriptBlockBase : ScriptBlock
622623
{
623624
public abstract ICompressor Minifier { get; }
624-
625+
public override ScriptLanguage Body => ScriptVerbatim.Language;
626+
625627
//reduce string allocation of block contents at runtime
626628
readonly ConcurrentDictionary<ReadOnlyMemory<char>, Tuple<string,string>> allocatedStringsCache =
627629
new ConcurrentDictionary<ReadOnlyMemory<char>, Tuple<string,string>>();

0 commit comments

Comments
 (0)