Commit 6e084b4a authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

enh: voice call skip code block & expression

parent fd96c9c6
......@@ -506,12 +506,16 @@ export const removeEmojis = (str) => {
return str.replace(emojiRegex, '');
};
export const removeFormattings = (str) => {
return str.replace(/(\*)(.*?)\1/g, '').replace(/(```)(.*?)\1/gs, '');
};
export const extractSentences = (text) => {
// Split the paragraph into sentences based on common punctuation marks
const sentences = text.split(/(?<=[.!?])\s+/);
return sentences
.map((sentence) => removeEmojis(sentence.trim()))
.map((sentence) => removeFormattings(removeEmojis(sentence.trim())))
.filter((sentence) => sentence !== '');
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment