Skip to content

Code syntax highlight library #3401

Closed Answered by UziTech
ivanjaros asked this question in Q&A
Aug 11, 2024 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

No you can use marked.use to use extensions after instantiation.

const marked = new Marked({
    async: true,
    breaks: true,
    gfm: true,
    extensions: [foo, bar],
    walkTokens: async (token) => { ... }
});

marked.use(markedHighlight({...}));

You can also add multiple extensions to new Marked

const marked = new Marked({
    async: true,
    breaks: true,
    gfm: true,
    extensions: [foo, bar],
    walkTokens: async (token) => { ... }
},
markedHighlight({...}));

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@UziTech
Comment options

@ivanjaros
Comment options

@ivanjaros
Comment options

@UziTech
Comment options

Answer selected by ivanjaros
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