2017-11-22 18:40:11 +00:00
|
|
|
import renderMath from './render_math';
|
|
|
|
import renderMermaid from './render_mermaid';
|
2017-12-13 09:26:44 +00:00
|
|
|
import syntaxHighlight from './syntax_highlight';
|
2016-12-09 00:15:08 +00:00
|
|
|
// Render Gitlab flavoured Markdown
|
|
|
|
//
|
2017-11-22 03:12:04 +00:00
|
|
|
// Delegates to syntax highlight and render math & mermaid diagrams.
|
2016-12-09 00:15:08 +00:00
|
|
|
//
|
2017-11-22 18:22:15 +00:00
|
|
|
$.fn.renderGFM = function renderGFM() {
|
2017-12-13 09:26:44 +00:00
|
|
|
syntaxHighlight(this.find('.js-syntax-highlight'));
|
2017-11-22 18:40:11 +00:00
|
|
|
renderMath(this.find('.js-render-math'));
|
|
|
|
renderMermaid(this.find('.js-render-mermaid'));
|
2017-11-22 18:22:15 +00:00
|
|
|
return this;
|
|
|
|
};
|
2016-12-09 00:15:08 +00:00
|
|
|
|
2017-11-22 18:22:15 +00:00
|
|
|
$(() => $('body').renderGFM());
|