'commit'
This commit is contained in:
31
test_marked.html
Normal file
31
test_marked.html
Normal file
@@ -0,0 +1,31 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user