- Vue.js 2 Web Development Projects
- Guillaume Chau
- 81字
- 2021-07-02 22:34:25
The preview pane
To compile the note markdown into valid HTML, we will need an additional library called Marked (https://www.npmjs.com/package/marked):
- Include the library in the page just after the script tag referencing Vue:
<!-- Include the library in the page --> <script src="https://unpkg.com/vue/dist/vue.js"></script> <!-- Add the marked library: --> <script src="https://unpkg.com/marked"></script>
marked is very easy to use--just call it with the markdown text, and it will return the corresponding HTML.
- Try the library with some markdown text:
const html = marked('**Bold** *Italic* [link]
(http://vuejs.org/)') console.log(html)
You should have the following output in the browser console:
<p><strong>Bold</strong> <em>Italic</em>
<a >link</a></p>
推薦閱讀
- GeoServer Cookbook
- LabVIEW2018中文版 虛擬儀器程序設計自學手冊
- Python程序設計
- SQL Server與JSP動態網站開發
- 微服務架構深度解析:原理、實踐與進階
- D3.js By Example
- HTML5+CSS3+jQuery Mobile APP與移動網站設計從入門到精通
- Arduino電子設計實戰指南:零基礎篇
- Yii2 By Example
- Mastering Unreal Engine 4.X
- Visual FoxPro程序設計習題及實驗指導
- Python量子計算實踐:基于Qiskit和IBM Quantum Experience平臺
- C語言從入門到精通(第4版)
- WCF 4.5 Multi-Layer Services Development with Entity Framework(Third Edition)
- 數據分析從入門到進階