19 lines
755 B
JavaScript
19 lines
755 B
JavaScript
import { marked } from 'marked'
|
|
import markedMfm from '../src/index.js'
|
|
|
|
describe('marked-mfm', () => {
|
|
test('inline', () => {
|
|
marked.use(markedMfm)
|
|
expect(marked('$[x2 this text is bigger]')).toBe('<p><span style="display: inline-block" class="x2">this text is bigger</span></p>\n')
|
|
})
|
|
|
|
test('nested', () => {
|
|
marked.use(markedMfm)
|
|
expect(marked('$[twitch twitch $[sparkle sparkle]]')).toBe('<p><span style="display: inline-block" class="twitch">twitch <span style="display: inline-block" class="sparkle">sparkle</span></span></p>\n')
|
|
})
|
|
|
|
test('invalid', () => {
|
|
marked.use(markedMfm)
|
|
expect(marked('$[invalid $[x2 test]]')).toBe('<p>$[invalid <span style="display: inline-block" class="x2">test</span>]</p>\n')
|
|
})
|
|
})
|