From 348a6bc3607b9f13445333804552c5c2641a102d Mon Sep 17 00:00:00 2001 From: George Lemon Date: Mon, 18 Mar 2024 11:16:55 +0200 Subject: [PATCH] fix `showHtmlErrors` Signed-off-by: George Lemon --- src/tim.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tim.nim b/src/tim.nim index bb03f80..74c101b 100755 --- a/src/tim.nim +++ b/src/tim.nim @@ -326,7 +326,7 @@ proc precompile*(engine: TimEngine, callback: TimCallback = nil, template layoutWrapper(getViewBlock) {.dirty.} = result = DOCKTYPE var layoutTail: string - var displayError: bool + var hasError: bool if not layout.jitEnabled: # when requested layout is pre-rendered # will use the static HTML version from disk @@ -340,10 +340,10 @@ template layoutWrapper(getViewBlock) {.dirty.} = getViewBlock layoutTail = jitLayout.getTail() else: - displayError = true + hasError = true jitLayout.logger.displayErrors() when not defined release: - if displayError: + if engine.showHtmlErrors and hasError: add result, htmlerror htmlerror = "" add result, layoutTail