Turn export into an object

we have no options
This commit is contained in:
Sol Fisher Romanoff 2022-07-08 11:39:48 +03:00
parent 003d398450
commit 76904e0888
Signed by: nbsp
GPG Key ID: 9D3F2B64F2341B62
2 changed files with 4 additions and 8 deletions

View File

@ -1,4 +1,4 @@
export default (options = {}) => ({
export default {
extensions: [
{
name: 'mfm',
@ -37,4 +37,4 @@ export default (options = {}) => ({
},
},
]
})
}

View File

@ -2,17 +2,13 @@ import { marked } from 'marked'
import markedMfm from '../src/index.js'
describe('marked-mfm', () => {
beforeEach(() => {
marked.setOptions(marked.getDefaults())
})
test('inline', () => {
marked.use(markedMfm())
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())
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')
})
})