fix: autocomplete fallback markdown + error catch
CI / lint (push) Failing after 1s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Failing after -8s

This commit is contained in:
2026-06-16 10:40:03 -04:00
parent dab76c86f3
commit d3b8062b6e
+6 -1
View File
@@ -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();