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