mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-01-14 00:27:55 +00:00
Docs: Update benchmark results
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
const parseMarkdown = async m => {
|
||||
async function parseMarkdown(md) {
|
||||
const u = 'https://cdn.jsdelivr.net/npm/marked@9/lib/marked.esm.js';
|
||||
const o = {gfm:true,breaks:true,headerIds:false,mangle:false};
|
||||
|
||||
try {
|
||||
const {marked} = await import('https://esm.sh/marked');
|
||||
return marked.parse(m);
|
||||
} catch (e) {
|
||||
return `<pre>${e.message}</pre>`;
|
||||
const {marked} = await import(u);
|
||||
marked.setOptions(o);
|
||||
return marked.parse(md);
|
||||
} catch(e) {
|
||||
return `<p>${e.message}</p>`;
|
||||
}
|
||||
};
|
||||
}
|
||||
export default parseMarkdown;
|
||||
Reference in New Issue
Block a user