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

186
Vistas
How to have more instances of marked js in one project?

My problem, which I cannot overcome is that I cannot achieve a state where I have 2 parallel instances oh markedjs which work fully independently in terms of configuration I am passing through.

In other words I need two different markdown handlers, as in one case I want to parse markdowned text using say algorithm X, and the other using alghorithm Z. But from what I read in official docs it's... impossible...? Really?

Calling marked.use() to override the same function multiple times will give priority to the version that was assigned last. Overriding functions can return false to fall back to the previous override in the sequence, or resume default behavior if all overrides return false. Returning any other value (including nothing) will prevent fallback behavior.

And indeed, that's how it works on my end - I use marked.parse() in two different parts of app and I see changes reflected in both places even though I try to conditionally change the configuration (using flag or something, doesn't matter, the result is always the same).

How to fix it? How can one develop such nonsensefull solution?

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