Tue Mar 14 2023 16:48:47 GMT+0000 (Coordinated Universal Time)
Saved by @viktor_atanasov
export const findAndReplaceSpecialSymbols = (text?: string) => { if (!text) return ""; const textToReplace = _isArray(text) ? text[0] : text; const pattern = /{{(.*?)}}/g; return textToReplace.replace( pattern, '<span>$1</span>' ); };
Copy this HTML code:
Preview:
open_in_newInstructions on embedding in Medium
Comments