1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

Added ToC support

- added `markdown-it-toc-and-anchor` into the project
- integrated it, create a table of contents every in a markup by adding
`@[TOC]`
This commit is contained in:
georg
2017-03-04 17:48:17 +01:00
parent ac2c50c8bc
commit 57835d0e32
3 changed files with 7 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
import markdownit from 'markdown-it'
import emoji from 'markdown-it-emoji'
import math from '@rokt33r/markdown-it-math'
import tocAndAnchor from "markdown-it-toc-and-anchor"
import _ from 'lodash'
const katex = window.katex
@@ -36,6 +37,9 @@ var md = markdownit({
md.use(emoji, {
shortcuts: {}
})
md.use(tocAndAnchor, {
anchorLink: false
})
md.use(math, {
inlineRenderer: function (str) {
let output = ''