Fix indented container directives
Closes GH-1.
This commit is contained in:
parent
20b2396fe9
commit
d9da5c508d
2 changed files with 31 additions and 1 deletions
|
@ -104,7 +104,13 @@ function tokenizeDirectiveContainer(effects, ok, nok) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function chunkStart(code) {
|
function chunkStart(code) {
|
||||||
var token = effects.enter('chunkDocument', {
|
var token
|
||||||
|
|
||||||
|
if (code === null) {
|
||||||
|
return after(code)
|
||||||
|
}
|
||||||
|
|
||||||
|
token = effects.enter('chunkDocument', {
|
||||||
contentType: 'document',
|
contentType: 'document',
|
||||||
previous: previous
|
previous: previous
|
||||||
})
|
})
|
||||||
|
|
24
test.js
24
test.js
|
@ -1020,6 +1020,30 @@ test('micromark-extension-directive (syntax)', function (t) {
|
||||||
'should support a thematic break before a container'
|
'should support a thematic break before a container'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
t.equal(
|
||||||
|
micromark(' :::x\n ', options({'*': h})),
|
||||||
|
'<x></x>',
|
||||||
|
'should support prefixed containers (1)'
|
||||||
|
)
|
||||||
|
|
||||||
|
t.equal(
|
||||||
|
micromark(' :::x\n - a', options({'*': h})),
|
||||||
|
'<x>\n<ul>\n<li>a</li>\n</ul>\n</x>',
|
||||||
|
'should support prefixed containers (2)'
|
||||||
|
)
|
||||||
|
|
||||||
|
t.equal(
|
||||||
|
micromark(' :::x\n - a\n > b', options({'*': h})),
|
||||||
|
'<x>\n<ul>\n<li>a</li>\n</ul>\n<blockquote>\n<p>b</p>\n</blockquote>\n</x>',
|
||||||
|
'should support prefixed containers (3)'
|
||||||
|
)
|
||||||
|
|
||||||
|
t.equal(
|
||||||
|
micromark(' :::x\n - a\n > b\n :::', options({'*': h})),
|
||||||
|
'<x>\n<ul>\n<li>a</li>\n</ul>\n<blockquote>\n<p>b</p>\n</blockquote>\n</x>',
|
||||||
|
'should support prefixed containers (4)'
|
||||||
|
)
|
||||||
|
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue