Skip to content

Commit

Permalink
inline span test
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Feb 2, 2025
1 parent 971bbf2 commit a07dd2d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/nuemark/test/inline.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,23 @@ test('parse simple image', () => {
expect(img.href).toBe('yo.svg')
})

test('inline span', () => {
const md = 'hello [.green "world"]!'
const [text, span] = parseInline(md)
expect(span.is_span).toBeTrue()

const result = renderInline(md)
expect(result).toBe('hello <span class="green">world</span>!')
})

test('empty inline span', () => {
const result = renderInline('[.myclass#myid]')
expect(result).toStartWith('<span ')
expect(result).toInclude('class="myclass"')
expect(result).toInclude('id="myid"')
expect(result).toEndWith('></span>')
})


// parse tags and args
test('inline tag', () => {
Expand Down

0 comments on commit a07dd2d

Please sign in to comment.