gitlab-org--gitlab-foss/app/assets/javascripts/render_gfm.js

16 lines
438 B
JavaScript
Raw Normal View History

2017-11-22 13:40:11 -05:00
import renderMath from './render_math';
import renderMermaid from './render_mermaid';
2017-03-17 13:21:25 -04:00
// Render Gitlab flavoured Markdown
//
2017-11-21 22:12:04 -05:00
// Delegates to syntax highlight and render math & mermaid diagrams.
//
$.fn.renderGFM = function renderGFM() {
this.find('.js-syntax-highlight').syntaxHighlight();
2017-11-22 13:40:11 -05:00
renderMath(this.find('.js-render-math'));
renderMermaid(this.find('.js-render-mermaid'));
return this;
};
$(() => $('body').renderGFM());