table.js 538 B

123456789101112131415161718
  1. export default class TableConfigurer {
  2. constructor(crowi) {
  3. this.crowi = crowi;
  4. }
  5. configure(md) {
  6. md.renderer.rules.table_open = (tokens, idx) => {
  7. const beginLine = tokens[idx].map[0] + 1;
  8. const endLine = tokens[idx].map[1];
  9. return `<div><button onClick="crowi.launchHandsonTableModal('page', ${beginLine}, ${endLine})"><i class="fa fa-table"></i></button><table class="table table-bordered">`;
  10. };
  11. md.renderer.rules.table_close = (tokens, idx) => {
  12. return '</table></div>';
  13. };
  14. }
  15. }