官术网_书友最值得收藏!

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):

  1. 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.

  1. 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>
主站蜘蛛池模板: 新营市| 德州市| 罗平县| 赞皇县| 临潭县| 钟山县| 曲阜市| 威海市| 仲巴县| 淄博市| 昭苏县| 桂东县| 中阳县| 桂东县| 攀枝花市| 广丰县| 泽普县| 肇庆市| 游戏| 洪湖市| 游戏| 翼城县| 鸡西市| 会理县| 龙陵县| 东兰县| 内黄县| 江油市| 祥云县| 高陵县| 安宁市| 水城县| 双流县| 芦山县| 平利县| 腾冲县| 寿光市| 揭东县| 高青县| 玉田县| 乐业县|