How can I take a string like this: *Up to* $1,000
and turn it into this: <span>Up to</span> $1,000
The stars can be anywhere in the string and also there can be multiple sets of stars. But each set should replaced with span's.
e.g.
text *test* here
= text <span>test</span> here
text here *test* right *now*
= text here <span>test</span> right <span>now</span>
I need to be able to pass the value into a function and receive the formatted string in return. Thanks ahead of time.