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

124
Visualizações
Inserting code blocks html with Jquery to detect if it should add

Okay so I have made a few posts like this basically I have a chat application on my website which I want to now add a way to insert code like this website stackoverflow has the code blocks for when you ask questions.


const codePattern = //jquery pattern here 

function makeCodeBlock(str) {
  return str.replace(codePattern, (s, match) => `<pre><code class="node.js">${match}</code></pre>`);
  
}

I wanna detect like when people type ` three times and the code block would be created from when the first three of that character are typed until they are typed another three times kind of like Discord's code blocks I just need to make my function be able to output the text inside of the three blacktick symbols and output what I have in my code above just removing the blackticks and using the code.

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