Peter Stuifzand
5cc4e65638
All checks were successful
continuous-integration/drone/push Build is passing
26 lines
662 B
JavaScript
26 lines
662 B
JavaScript
import MarkdownIt from "markdown-it";
|
|
import MarkdownItWikilinks from "./wikilinks";
|
|
import MarkdownItMark from "markdown-it-mark";
|
|
import MarkdownItKatex from "markdown-it-katex";
|
|
|
|
const MD = new MarkdownIt({
|
|
linkify: true,
|
|
highlight: function (str, lang) {
|
|
if (lang === 'mermaid') {
|
|
return '<div class="mermaid">' + str + '</div>';
|
|
}
|
|
return '';
|
|
}
|
|
})
|
|
|
|
MD.use(MarkdownItWikilinks({
|
|
baseURL: document.querySelector('body').dataset.baseUrl,
|
|
uriSuffix: '',
|
|
relativeBaseURL: '/edit/',
|
|
htmlAttributes: {
|
|
class: 'wiki-link'
|
|
},
|
|
})).use(MarkdownItMark).use(MarkdownItKatex)
|
|
|
|
export default MD;
|