Skip to content

Commit 5dd31e7

Browse files
committed
Fix types to allow definitions in container directives
1 parent 849a112 commit 5dd31e7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

index.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {BlockContent, PhrasingContent} from 'mdast'
1+
import type {BlockContent, DefinitionContent, PhrasingContent} from 'mdast'
22

33
export {directiveFromMarkdown, directiveToMarkdown} from './lib/index.js'
44

@@ -29,7 +29,7 @@ export interface ContainerDirective extends Parent, DirectiveFields {
2929
/**
3030
* Content.
3131
*/
32-
children: BlockContent[]
32+
children: Array<BlockContent | DefinitionContent>
3333
}
3434

3535
/**

lib/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* @typedef {import('mdast').BlockContent} BlockContent
3+
* @typedef {import('mdast').DefinitionContent} DefinitionContent
34
* @typedef {import('mdast').Paragraph} Paragraph
45
*
56
* @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext
@@ -416,7 +417,7 @@ function attributes(node, state) {
416417
}
417418

418419
/**
419-
* @param {BlockContent} node
420+
* @param {BlockContent | DefinitionContent} node
420421
* @returns {node is Paragraph & {data: {directiveLabel: boolean}}}
421422
*/
422423
function inlineDirectiveLabel(node) {

0 commit comments

Comments
 (0)