[wp-trac] [WordPress Trac] #36783: wplink should prioritize textContent over innerText so as to ignore any text-transform styling

WordPress Trac noreply at wordpress.org
Sat May 7 16:26:46 UTC 2016


#36783: wplink should prioritize textContent over innerText so as to ignore any
text-transform styling
----------------------------+-----------------------------
 Reporter:  dougwollison    |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Editor          |    Version:  trunk
 Severity:  normal          |   Keywords:
  Focuses:  ui, javascript  |
----------------------------+-----------------------------
 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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36783>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list