JSFiddle - React, Tailwind, and code Playground

by 2Yootz

JavaScript

var precedingText = 'Chad is the man <a href="mailto:www.chadkuehn.com">link</a>';
precedingText = 'ddfdfdfdmailto:';

if (/mailto\:$/i.test(precedingText)) {
alert('in');
console.log(precedingText);
        precedingText = precedingText.substring(
          precedingText,
          precedingText.length - 'mailto:'.length
        );
      }