UNPKG

showdown-katex

Version:

showdown extension that adds latex and asciimath support

22 lines (17 loc) 528 B
import test from 'ava'; import showdown from 'showdown'; import katex from '../lib/showdown-katex'; const input = '# hello, markdown!'; const output = '<h1 id="hellomarkdown">hello, markdown!</h1>'; test('string extension', t => { const converter = new showdown.Converter({ extensions: ['showdown-katex'], }); t.is(converter.makeHtml(input), output); }); test('function extension', t => { const converter = new showdown.Converter({ extensions: [katex()], }); t.is(converter.makeHtml(input), output); });