medfreeman / markdown-it-toc-and-anchor

markdown-it plugin to add a toc and anchor links in headings
MIT License
60 stars 35 forks source link

TypeError: Cannot read property 'breaks' of undefined #33

Closed EYHN closed 7 years ago

EYHN commented 7 years ago
var markdownIt = require('markdown-it'),
    markdownItTocAndAnchor = require('markdown-it-toc-and-anchor').default;

markdownIt({
    html: true,
    linkify: true,
    typography: true,
  })
    .use(markdownItTocAndAnchor, {
      // ...options
    })
    .render("## Hello World! Hexo!\n\n从wordpress转Hexo啦!\n\n<!--more-->\n\n### Hello World! Hexo!\n\n## Hello World! Hexo!\n\nHexo真的比wordpress,geek多了,零成本博客不是梦!\n\n## Hello World! Hexo!\n\n现在还在配置主题和Hexo,下面列出建站过程中利用到的工具和开源项目。顺便熟悉markdown语法。\n\n#### Hello World! Hexo!\n\n* [Hexo](https://hexo.io) 基于node的博客框架\n* [hexo-theme-material](https://github.com/viosey/hexo-theme-material) Material 原质 -- 酷炫的md风格主题\n* [Coding](https://coding.net) 国内免费的pages服务,本站由Coding托管\n* [Vscode](https://code.visualstudio.com/) 我使用vscode写markdown\n\n头像自动同步qq头像,调用的是这个接口\n\n[http://q1.qlogo.cn/headimg_dl?bs=QQ号&dst_uin=QQ号&spec=100&url_enc=0&referer=bu_interface&term_type=PC](http://q1.qlogo.cn/headimg_dl?bs=1106996185&dst_uin=1106996185&spec=100&url_enc=0&referer=bu_interface&term_type=PC)")

image

EYHN commented 7 years ago

Please update your NPM package as soon as possible !!!

medfreeman commented 7 years ago

Done: https://www.npmjs.com/package/markdown-it-toc-and-anchor