Skip to content

Commit df54f43

Browse files
heiskrCopilot
andauthored
Short-circuit Liquid rendering for plain-text strings (#60522)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 771735d commit df54f43

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/content-render/liquid/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { processLiquidPost } from './post'
22
import { engine } from './engine'
33

44
export async function renderLiquid(template: string, context: any): Promise<string> {
5-
template = await engine.parseAndRender(template, context)
5+
if (template.includes('{%') || template.includes('{{')) {
6+
template = await engine.parseAndRender(template, context)
7+
}
68
template = processLiquidPost(template)
79
return template
810
}

0 commit comments

Comments
 (0)