Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

122
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!