From d3b8062b6e5124afd5bc0e6573a6081b6c7c84c9 Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Tue, 16 Jun 2026 10:40:03 -0400 Subject: [PATCH] fix: autocomplete fallback markdown + error catch --- frontend/editor-poc.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/editor-poc.html b/frontend/editor-poc.html index 55caecc..e350a26 100644 --- a/frontend/editor-poc.html +++ b/frontend/editor-poc.html @@ -1743,13 +1743,18 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig m.searchWikilinks(result.partial || '', function(items) { showAutocomplete(items, 'Wikilinks'); }); - } else if (result.items.length > 0) { + } else if (result.items && result.items.length > 0) { var ctxLabels = { mermaid: 'Mermaid', code: 'Code', fence_open: 'Langage', frontmatter: 'Frontmatter', markdown: 'Markdown' }; showAutocomplete(result.items, ctxLabels[result.context] || result.context); + } else { + // Fallback: show markdown formatting suggestions + showAutocomplete(m.MARKDOWN_FORMAT, 'Markdown'); } + }).catch(function(err) { + console.error('[Autocomplete] Failed to load module:', err); }); }; loadAndTrigger();