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

123
Vistas
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 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