I'm using marked.js to convert my text to html. I have the following code to disable bunch of commands, including header (# text), list/listItem and etc. but it doesn't disable "italic" and "bold". Anyone here knows how to get that to work. Thank you
const getUnfilteredContent = (content) => {
const lexer = new marked.Lexer({});
var list = [
'em',
'emStrong',
'code',
'def',
'lheading',
'fences',
'blockquote',
'html',
'heading',
'hr',
'list',
'listitem',
'paragraph',
'table',
'tablerow',
'tablecell',
'strong',
'codespan',
'br',
'del',
'link',
'image',
];
for (let i in list) {
const key = list[i];
lexer.tokenizer.rules.block[key] = { exec: function () { } }
}
return lexer.lex(content);
}
marked.parser(getUnfilteredContent(value), {})