Skip to content

Commit

Permalink
Nuemark (2): add test for [[my-tag]](/) #379
Browse files Browse the repository at this point in the history
  • Loading branch information
tipiirai committed Oct 21, 2024
1 parent f97df98 commit 4820038
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/nuemark/test/inline.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,18 @@ test('inline tag with reflink', () => {
expect(link.is_reflink).toBeTrue()
})

test('link with a tag', () => {
const html = renderInline('[[my-tag]](/)')
expect(html).toBe('<a href="/"><my-tag custom="my-tag"></my-tag></a>')
})

test('links with tags', () => {
test('link with image tag', () => {
const html = renderInline('lol [[! yo.svg]](/)')
expect(html).toStartWith('lol <a href="/">')
expect(html).toEndWith('src="yo.svg"></figure></a>')
})


test('tag args', () => {
const [ text, comp, rest] = parseInline('Hey [print foo] thing')
expect(comp.name).toBe('print')
Expand Down

0 comments on commit 4820038

Please sign in to comment.