How to create a custom Markdown rules #2543
Answered
by
UziTech
ArvindhMangoleap
asked this question in
Q&A
-
I am trying to build a parser that converts markdown into WhatsApp compatible format For example, Whatsapp uses underscore ( _ ) on both sides of the string for Italic instead of start ( * ) WhatsApp WhatsApp I can use custom extensions to overwrite bold, italics etc. Is there a way to disable all other render methods like list, paragraph, table, etc? Because I don't need them. |
Beta Was this translation helpful? Give feedback.
Answered by
UziTech
Jul 29, 2022
Replies: 1 comment
-
you can create your own tokenizer and return undefined to prevent marked from creating a token. const tokenizer = {
heading() {
// return nothing/undefined to prevent tokenization
}
};
marked.use({ tokenizer }); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ArvindhMangoleap
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can create your own tokenizer and return undefined to prevent marked from creating a token.