Skip to content

Commit

Permalink
πŸ› Skip broken third-party Markdown extensions (#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lemmingh committed Oct 18, 2020
1 parent 3037848 commit 480979c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/markdownEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@ class MarkdownEngine {
if (extensionBlacklist.has(contribute.extensionId)) {
continue;
}
md = await contribute.extendMarkdownIt(md);

// Skip the third-party Markdown extension, if it is broken or crashes.
try {
md = await contribute.extendMarkdownIt(md);
} catch (err) {
// Use the multiple object overload, so that the console can output the error object in its own way, which usually keeps more details than `toString`.
console.warn(`[yzhang.markdown-all-in-one]:\nSkipped Markdown extension: ${contribute.extensionId}\nReason:`, err);
}
}
return md;
}
Expand Down

0 comments on commit 480979c

Please sign in to comment.