Add test for break in directive (text) label
This commit is contained in:
parent
6034170cf1
commit
7f23ba84fe
1 changed files with 13 additions and 1 deletions
|
@ -12,14 +12,16 @@ import {directive, directiveHtml} from 'micromark-extension-directive'
|
||||||
|
|
||||||
const own = {}.hasOwnProperty
|
const own = {}.hasOwnProperty
|
||||||
|
|
||||||
test('micromark-extension-directive (syntax, text)', async function (t) {
|
test('micromark-extension-directive (core)', async function (t) {
|
||||||
await t.test('should expose the public api', async function () {
|
await t.test('should expose the public api', async function () {
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
Object.keys(await import('micromark-extension-directive')).sort(),
|
Object.keys(await import('micromark-extension-directive')).sort(),
|
||||||
['directive', 'directiveHtml']
|
['directive', 'directiveHtml']
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
test('micromark-extension-directive (syntax, text)', async function (t) {
|
||||||
await t.test(
|
await t.test(
|
||||||
'should support an escaped colon which would otherwise be a directive',
|
'should support an escaped colon which would otherwise be a directive',
|
||||||
async function () {
|
async function () {
|
||||||
|
@ -179,6 +181,16 @@ test('micromark-extension-directive (syntax, text)', async function (t) {
|
||||||
assert.equal(micromark(':a[a *b* c]asd', options()), '<p>asd</p>')
|
assert.equal(micromark(':a[a *b* c]asd', options()), '<p>asd</p>')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
await t.test(
|
||||||
|
'should support markdown in an label (hard break)',
|
||||||
|
async function () {
|
||||||
|
assert.equal(
|
||||||
|
micromark(':x[a \nb]c', options({'*': h})),
|
||||||
|
'<p><x>a<br />\nb</x>c</p>'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
await t.test('should support a directive in an label', async function () {
|
await t.test('should support a directive in an label', async function () {
|
||||||
assert.equal(micromark('a :b[c :d[e] f] g', options()), '<p>a g</p>')
|
assert.equal(micromark('a :b[c :d[e] f] g', options()), '<p>a g</p>')
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue