markdown语法

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.7.0/marked.js"></script>
</head>
<body>
<div id="content"></div>
<script>
var markdown=`
# Marked in the browser
## Rendered by **marked**.
[百度](http://baidu.com)
`
var html= marked(markdown);
document.getElementById(‘content‘).innerHTML =html;
</script>
</body>
</html>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.7.0/marked.js"></script>
</head>
<body>
<div id="content"></div>
<script>
var markdown=`
# 我的第一遍博客

**小凌**
>不要相信网上的名人名言。——鲁迅
大家好我今天学会了markdown语法了。
![](https://p0.meituan.net/dpmerchantpic/659eb04d72c3f511dfa6ea9d55fcbd08541010.jpg%40watermark%3D1%26%26r%3D1%26p%3D9%26x%3D2%26y%3D2%26relative%3D1%26o%3D20)
`
var html= marked(markdown);
document.getElementById(‘content‘).innerHTML =html;
</script>
</body>

相关推荐