common-plugins.js 594 B

123456789101112131415161718192021222324252627
  1. export default class CommonPluginsConfigurer {
  2. constructor(crowi) {
  3. this.crowi = crowi;
  4. }
  5. configure(md) {
  6. md.use(require('markdown-it-footnote'))
  7. .use(require('markdown-it-task-lists'), {
  8. enabled: true,
  9. })
  10. .use(require('markdown-it-toc-and-anchor').default, {
  11. anchorLinkBefore: false,
  12. anchorLinkSymbol: '',
  13. anchorLinkSymbolClassName: 'fa fa-link',
  14. anchorClassName: 'revision-head-link',
  15. })
  16. ;
  17. md.set({
  18. tocCallback: (tocMarkdown, tocArray, tocHtml) => {
  19. // TODO impl
  20. },
  21. });
  22. }
  23. }