I would like to use jQuery for:
- select any punctuation marks (meaning
. , ; : ' " “ ” ‘ ’, etc.) that occur immediately before and after any links and then - circle the punctuation marks in
spans.
This implies:
<div id="mydiv">
Lorem ipsum
<a href="#">dolor sit amet</a>,
consectetur
“<a href="#">adipisicing elit</a>”.
</div>
to become next:
<div id="mydiv">
Lorem ipsum
<a href="#">dolor sit amet</a><span>,</span>
consectetur
<span>“</span><a href="#">adipisicing elit</a><span>”.</span>
</div>
(BTW, &ldquoand ”are quotation marks.)
The content in is divnot fixed. There may also be cases where next to the link (for example, higher, ”.more than one punctuation mark) becomes <span>”.</span>)
It would be very helpful to help !!
Sort of similar (but not quite) to this question regarding the choice of text nodes? Using jQuery, how to change text outside tags?