Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Discussion options

You must be logged in to vote

You can use the original renderer to render the table.

import { Marked, Renderer } from 'marked';

const renderer = new Renderer();

const marked = new Marked({
  renderer: {
    table(...arguments) {
      return `<div>${renderer.table.apply(this, arguments)}</div>`;
    },
  },
});

console.log(marked.parse(`
| a | b |
| - | - |
| c | d |
`));

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@YanceyOfficial
Comment options

Answer selected by YanceyOfficial
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants