Untitled
unknown
plain_text
a year ago
671 B
2
Indexable
$('.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()); });
Editor is loading...
Leave a Comment