Replacing the search and replace to insert icons with https://github.com/padolsey/findAndReplaceDOMText. Many thanks to the author!