fix: inconsistent continue behaviour, fixes #779

This commit is contained in:
Harttle
2024-12-22 16:32:08 +08:00
committed by Jun Yang
parent 2af297f81a
commit e3ef574674
7 changed files with 37 additions and 12 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ export class Render {
const html = yield tpl.render(ctx, emitter)
// if not, it'll return an `html`, write to the emitter for it
html && emitter.write(html)
if (emitter['break'] || emitter['continue']) break
if (ctx.breakCalled || ctx.continueCalled) break
} catch (e) {
const err = LiquidError.is(e) ? e : new RenderError(e as Error, tpl)
if (ctx.opts.catchAllErrors) errors.push(err)