We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fef8258 commit 893841bCopy full SHA for 893841b
1 file changed
cmd/chromad/static/index.js
@@ -233,6 +233,10 @@ function init() {
233
const formData = getFormJSON();
234
const value = await render(formData);
235
236
+ if (value.error) {
237
+ throw new Error(value.error);
238
+ }
239
+
240
if (value.language) {
241
languageSelect.value = value.language;
242
}
@@ -243,13 +247,9 @@ function init() {
243
247
output.innerHTML = value.html;
244
248
245
249
} catch (error) {
246
- console.error("Error highlighting code:", error);
- // Fallback: display plain text
- if (htmlCheckbox.checked) {
- output.innerText = textArea.value;
250
- } else {
251
- output.innerHTML = `<pre>${textArea.value}</pre>`;
252
- }
+ const errorMsg = `Error highlighting code: ${error}`;
+ output.innerText = errorMsg;
+ console.error(errorMsg);
253
254
255
if (event) {
0 commit comments