I know there are some similar questions out there, but I haven't been able to successfully adapt the code I've seen from similar questions.
Perhaps the big difference is that I'm not trying to search actual text nodes in the DOM, but I am storing strings in an object. I have a listings
object which I am populating with data from a classified listings API. So I want to take each listings[i].body
property, use a regular expression to find any telephone numbers, and then wrap them with <a href="tel:x">
. This same data will then be used to populate Google Maps Markers and Info Windows.