Remove warning for remark 12
This commit is contained in:
parent
35e8ccfd16
commit
3b94de5255
1 changed files with 0 additions and 19 deletions
19
index.js
19
index.js
|
@ -1,28 +1,9 @@
|
||||||
import {directive} from 'micromark-extension-directive'
|
import {directive} from 'micromark-extension-directive'
|
||||||
import {directiveFromMarkdown, directiveToMarkdown} from 'mdast-util-directive'
|
import {directiveFromMarkdown, directiveToMarkdown} from 'mdast-util-directive'
|
||||||
|
|
||||||
let warningIssued
|
|
||||||
|
|
||||||
export default function remarkDirective() {
|
export default function remarkDirective() {
|
||||||
const data = this.data()
|
const data = this.data()
|
||||||
|
|
||||||
// Old remark.
|
|
||||||
/* c8 ignore next 14 */
|
|
||||||
if (
|
|
||||||
!warningIssued &&
|
|
||||||
((this.Parser &&
|
|
||||||
this.Parser.prototype &&
|
|
||||||
this.Parser.prototype.blockTokenizers) ||
|
|
||||||
(this.Compiler &&
|
|
||||||
this.Compiler.prototype &&
|
|
||||||
this.Compiler.prototype.visitors))
|
|
||||||
) {
|
|
||||||
warningIssued = true
|
|
||||||
console.warn(
|
|
||||||
'[remark-directive] Warning: please upgrade to remark 13 to use this plugin'
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
add('micromarkExtensions', directive())
|
add('micromarkExtensions', directive())
|
||||||
add('fromMarkdownExtensions', directiveFromMarkdown)
|
add('fromMarkdownExtensions', directiveFromMarkdown)
|
||||||
add('toMarkdownExtensions', directiveToMarkdown)
|
add('toMarkdownExtensions', directiveToMarkdown)
|
||||||
|
|
Loading…
Add table
Reference in a new issue