Why Does WP insert an extra span tag?
-
Symptom: WP is adding a “span” tag to an anchor tag and I’m looking for the reasons:
In the WP editor I have the following html:
<p id="targetText1">The ...... It’s the <a href="https://xxxxxxxxxxxx/glossary/free-cash-flow" title="Glossary">Free Cash Flow</a> projections that form the <span class="s1">basis</span> of these high company valuations.</p>
However, the source code on the page shows the addition of a span tag inside the anchor tag:
<a href="xxxxxxxxxxxxx/glossary/free-cash-flow" title="Glossary"><span class="domtooltips" title="<div>lt;div id="sourceText1" class=""">Free Cash Flow</span></a>
The paragraph in question is used by a jquery script. Clicking on the link produces a dialog box showing content from a post. This works as expected.
However, when you mouse over the link a box appears with text that is obviously taken from the title in the span tag that WP has added, thus:
lt;div id=
The ‘id’ that has been inserted inside the additional span tag
id="sourceText1"
is coming from the post that appears in the dialog.This suggests perhaps a jquery conflict.
I’ve deregistered both the core UI and the dialog elements thus:
if ( !is_admin() ) { wp_deregister_script('jquery-ui-core','jquery-ui-dialog'); }
I’d appreciate any pointers on what might be the cause of this problem and how I can prevent WP from inserting the additional span tag.
Thanks
- The topic ‘Why Does WP insert an extra span tag?’ is closed to new replies.