markdown-it-directive
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "markdown-it-directive", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Directive extension for markdown-it markdown parser.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -69,3 +69,3 @@ # markdown-it-directive | ||
.use((md) => { | ||
md.inlineDirectives['directive-name'] = (state, content, dests, attrs, contentStart, contentEnd, directiveStart, directiveEnd) => { | ||
md.inlineDirectives['directive-name'] = ({state, content, dests, attrs, contentStart, contentEnd, directiveStart, directiveEnd}) => { | ||
const token = state.push('html_inline', '', 0); | ||
@@ -75,3 +75,3 @@ token.content = JSON.stringify({ directive: 'directive-name', content, dests, attrs }) + '\n'; | ||
md.blockDirectives['directive-name'] = ( | ||
md.blockDirectives['directive-name'] = ({ | ||
state, content, contentTitle, inlineContent, dests, attrs, | ||
@@ -82,3 +82,3 @@ contentStartLine, contentEndLine, | ||
directiveStartLine, directiveEndLine | ||
) => { | ||
}) => { | ||
const token = state.push('html_block', '', 0); | ||
@@ -85,0 +85,0 @@ token.map = [ directiveStartLine, directiveEndLine ]; |
@@ -13,2 +13,6 @@ # markdown-it-directive | ||
## 所需依赖 | ||
需要提前安装 `markdown-it`, `@types/markdown-it` ,详情参见 `package.json` 中的 `peerDependencies` 部分。 | ||
## API | ||
@@ -20,7 +24,7 @@ | ||
.use((md) => { | ||
md.inlineDirectives['aaa'] = (state, content, dests, attrs, contentStart, contentEnd, directiveStart, directiveEnd) => { | ||
md.inlineDirectives['aaa'] = ({state, content, dests, attrs, contentStart, contentEnd, directiveStart, directiveEnd}) => { | ||
// | ||
}; | ||
md.blockDirectives['aaa'] = ( | ||
md.blockDirectives['aaa'] = ({ | ||
state, content, contentTitle, inlineContent, dests, attrs, | ||
@@ -31,3 +35,3 @@ contentStartLine, contentEndLine, | ||
directiveStartLine, directiveEndLine | ||
) => { | ||
}) => { | ||
// | ||
@@ -66,3 +70,3 @@ }; | ||
.use((md) => { | ||
md.inlineDirectives['directive-name'] = (state, content, dests, attrs, contentStart, contentEnd, directiveStart, directiveEnd) => { | ||
md.inlineDirectives['directive-name'] = ({state, content, dests, attrs, contentStart, contentEnd, directiveStart, directiveEnd}) => { | ||
const token = state.push('html_inline', '', 0); | ||
@@ -72,3 +76,3 @@ token.content = JSON.stringify({ directive: 'directive-name', content, dests, attrs }) + '\n'; | ||
md.blockDirectives['directive-name'] = ( | ||
md.blockDirectives['directive-name'] = ({ | ||
state, content, contentTitle, inlineContent, dests, attrs, | ||
@@ -79,3 +83,3 @@ contentStartLine, contentEndLine, | ||
directiveStartLine, directiveEndLine | ||
) => { | ||
}) => { | ||
const token = state.push('html_block', '', 0); | ||
@@ -82,0 +86,0 @@ token.map = [ directiveStartLine, directiveEndLine ]; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28129