we have some code that overlays a glossary of terms as jquery popups on html content. It implements this by adding <a> tag around the term to be highlighted. The problem we have is that if the term is within a hyperlink then it corrups the link. We would like to exclude any text that is within a hypelink or other html tags. So, the replacement would take this:
Term1 <a href="#"> term 2</a>
and create this:
<a class=glossary>Term1</a> <a href="#">term 2</a>
term 2 is ignored as it is a hyperlink.
Is this possible?