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

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>
主站蜘蛛池模板: 凌源市| 板桥市| 双江| 湘潭县| 珠海市| 罗江县| 千阳县| 尼玛县| 龙川县| 昆山市| 东台市| 宁都县| 和平区| 海原县| 龙岩市| 瑞丽市| 双辽市| 湘潭县| 通化县| 永安市| 仁布县| 镇沅| 平顺县| 岫岩| 鹿泉市| 金塔县| 历史| 桑植县| 酉阳| 噶尔县| 柳江县| 兴文县| 荣成市| 开阳县| 石台县| 五华县| 海兴县| 闸北区| 巴里| 阿克陶县| 尼木县|