mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
fix(docs): regenerate playground GIF with held output during typing
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 35 KiB |
Vendored
+5
-1
@@ -52,6 +52,7 @@
|
||||
|
||||
const editors = [editor, dataEditor];
|
||||
let previewValue = '';
|
||||
let hadPreview = false;
|
||||
colorScheme.addEventListener('change', function() {
|
||||
editors.forEach(applyEditorTheme);
|
||||
if (previewValue) setPreview(previewValue);
|
||||
@@ -176,7 +177,10 @@
|
||||
history.replaceState({}, '', '#' + serializeArgs({tpl, data}));
|
||||
try {
|
||||
const html = await engine.parseAndRender(tpl, JSON.parse(data));
|
||||
setPreview(html);
|
||||
if (html !== '' || !hadPreview) {
|
||||
setPreview(html);
|
||||
if (html !== '') hadPreview = true;
|
||||
}
|
||||
} catch (err) {
|
||||
// keep last successful output while template or context is invalid
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user