Skip to content

How to disable tables and task lists when gfm: true? #2292

Answered by UziTech
rfgamaral asked this question in Q&A
Discussion options

You must be logged in to vote

You can replace the table tokenizer and always return undefined. And for the task list the easiest thing is probably to replace the checkbox renderer and output the text instead of a checkbox.

Something like:

const tokenizer = {
  table() {}
};

const renderer = {
  checkbox(checked) {
    return `[${checked ? 'x' : ' '}] `;
  }
};

marked.use({tokenizer, renderer});

Replies: 1 comment 1 reply

Comment options

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

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