网站备案审核时长查询:如何得知我的网站mx记录所需时间?
摘要:网站备案审核需要多久,查询网站mx记录,江门属于哪里,智联招聘网站怎么做微招聘信息markdown-it能够将markdown语法的内容转换为html内容,这样我们使用markdown语法写的笔记&am
网站备案审核需要多久,查询网站mx记录,江门属于哪里,智联招聘网站怎么做微招聘信息markdown-it能够将markdown语法的内容转换为html内容#xff0c;这样我们使用markdown语法写的笔记#xff0c;就可以转换作为网页使用了
Markdown语法
Markdown语法图文全面详解(10分钟学会)
基础使用
安装markdown-it
npm install markdown-it --save使用markdown-it …markdown-it能够将markdown语法的内容转换为html内容这样我们使用markdown语法写的笔记就可以转换作为网页使用了
Markdown语法
Markdown语法图文全面详解(10分钟学会)
基础使用
安装markdown-it
npm install markdown-it --save使用markdown-it
可以看到使用markdown-it我们把markdown语法的内容转为了html内容。我们发现md内容中标记的java语言代码会包裹再pre code标签中并且再highlight函数中回调。。 转化的html文档 style langscss.container {width: 600px;margin: 10px auto;textarea {outline: none;}}
/styletemplatediv classcontainertextarea v-modelmdContent rows6 stylewidth: 100%;/textareadiv v-htmlhtmlContent/div/div
/templatescript
import MarkdownIt from markdown-it
const MarkdownIt2 require(markdown-it)let md1 new MarkdownIt()
let md2 new MarkdownIt2()
console.log(md1);
console.log(md2);console.log(md1.render(# markdown-it rulezz!));/* h1markdown-it rulezz!/h1 */
console.log(md2.render(# markdown-it rulezz!));/* h1markdown-it rulezz!/h1 */const md new MarkdownIt({html: true,linkify: true,typographer: true,breaks: true,highlight: function(str, lang) {console.log(str-,str,lang-,lang);}
})export default {name: md2Html,data() {return {mdContent:,htmlContent:,}},watch: {mdContent(newVal,oldVal) {this.htmlContent md.render(newVal)}}
}
/script代码简单高亮1
根据我们前面学到的highlight.js的用法我们可以这么做在编辑的时候实时高亮就是在md转完html并且渲染完成后在$nextTick中高亮对应的html就可以了。
