#36783 closed defect (bug) (fixed)
wplink should prioritize textContent over innerText so as to ignore any text-transform styling
| Reported by: | dougwollison | Owned by: | azaozz |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.6 |
| Component: | Editor | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | ui, javascript |
Description
On numerous sites we add button styles that use all-caps text. For SEO purposes, we don't literally make the text all-caps and have CSS ensure it's that way via text-transform.
However, in wplink, the text content of the link will be pulled in all-caps form when editing the link. This is due to this line in wp-includes/js/wplink.js:
linkText = linkNode.innerText || linkNode.textContent;
Based on how the tinyMCE plugin works, it should be safe to swap those priorities around:
linkText = linkNode.textContent || linkNode.innerText;
I've done a quick test on a site and it pulls the real, untransformed text; though I'd imagine it needs further testing; but I'm pretty sure old IE will fallback properly to innerText, which if I'm not mistaken is handled like the new textContent would.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Reorders priority for linkText assignment