Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

184
Vistas
Disabling "italic" and "bold" features doesn't work in marked.js

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), {})
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda