mirror of
https://github.com/lynchmarkHQ/lynchmark.com.git
synced 2026-10-17 17:27:53 +00:00
11 lines
267 B
JavaScript
11 lines
267 B
JavaScript
const parseMarkdown = async s => {
|
|
if (typeof s !== 'string') return ''
|
|
try {
|
|
const { parse } = await import('https://cdn.jsdelivr.net/npm/marked/+esm')
|
|
return parse(s)
|
|
} catch (e) {
|
|
console.error(e)
|
|
return ''
|
|
}
|
|
}
|
|
export default parseMarkdown; |