31 lines
900 B
HTML
31 lines
900 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/12.0.0/marked.min.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="output"></div>
|
|
<div id="error" style="color: red;"></div>
|
|
<script>
|
|
try {
|
|
marked.use({
|
|
gfm: true,
|
|
breaks: true,
|
|
renderer: {
|
|
code(code, language) {
|
|
if (language === 'echarts') {
|
|
return 'ECHARTS';
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
const text = "- **Test Bold**";
|
|
const html = marked.parse(text);
|
|
document.getElementById('output').innerHTML = html;
|
|
} catch (e) {
|
|
document.getElementById('error').innerText = e.toString();
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |