Untitled

mail@pastecode.io avatar
unknown
plain_text
17 days ago
671 B
0
Indexable
Never
  $('.m-faq a, .m-faq-ans').each((index, element) => {
    let text = $(element).text();
    
    text = text.replace(/\bb\.\s/g, ''); // Matches and removes "b. " at the start of a word
    text = text.replace(/([a-z])([A-Z])/g, '$1 $2'); // Adds a space between a lowercase letter followed by an uppercase letter
    text = text.replace(/(\d)([A-Za-z])/g, '$1 $2'); // Adds a space between a digit followed by a letter
    text = text.replace(/([A-Za-z])(\d)/g, '$1 $2'); // Adds a space between a letter followed by a digit
    text = text.replace(/(\?)([A-Za-z])/g, '$1 $2'); // Adds a space after a question mark
    
    content.push(text.trim());
  });
Leave a Comment