debian-mirror-gitlab/app/assets/javascripts/render_gfm.js

16 lines
486 B
JavaScript
Raw Normal View History

2018-03-17 18:26:18 +05:30
import renderMath from './render_math';
import renderMermaid from './render_mermaid';
import syntaxHighlight from './syntax_highlight';
2017-08-17 22:00:37 +05:30
// Render Gitlab flavoured Markdown
//
2018-03-17 18:26:18 +05:30
// Delegates to syntax highlight and render math & mermaid diagrams.
2017-08-17 22:00:37 +05:30
//
2018-03-17 18:26:18 +05:30
$.fn.renderGFM = function renderGFM() {
syntaxHighlight(this.find('.js-syntax-highlight'));
renderMath(this.find('.js-render-math'));
renderMermaid(this.find('.js-render-mermaid'));
return this;
};
2017-08-17 22:00:37 +05:30
2018-03-17 18:26:18 +05:30
$(() => $('body').renderGFM());