|
|
@ -2,7 +2,7 @@ import fs from 'fs'
|
|
|
|
import MarkdownIt from 'markdown-it'
|
|
|
|
import MarkdownIt from 'markdown-it'
|
|
|
|
import { RuleBlock } from 'markdown-it/lib/parser_block'
|
|
|
|
import { RuleBlock } from 'markdown-it/lib/parser_block'
|
|
|
|
|
|
|
|
|
|
|
|
export const snippetPlugin = (md: MarkdownIt, root: string) => {
|
|
|
|
export const snippetPlugin = (md: MarkdownIt, root: string = process.cwd()) => {
|
|
|
|
const parser: RuleBlock = (state, startLine, endLine, silent) => {
|
|
|
|
const parser: RuleBlock = (state, startLine, endLine, silent) => {
|
|
|
|
const CH = '<'.charCodeAt(0)
|
|
|
|
const CH = '<'.charCodeAt(0)
|
|
|
|
const pos = state.bMarks[startLine] + state.tShift[startLine]
|
|
|
|
const pos = state.bMarks[startLine] + state.tShift[startLine]
|
|
|
|