Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

189
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda