[wp-trac] [WordPress Trac] #37382: Shiny Updates: error messages with HTML and wp.a11y.speak()

WordPress Trac noreply at wordpress.org
Sat Jul 16 12:13:35 UTC 2016


#37382: Shiny Updates: error messages with HTML and wp.a11y.speak()
-------------------------------------+-------------------------------------
 Reporter:  afercia                  |      Owner:
     Type:  defect (bug)             |     Status:  new
 Priority:  normal                   |  Milestone:  4.6
Component:  Plugins                  |    Version:  trunk
 Severity:  normal                   |   Keywords:  has-screenshots needs-
  Focuses:  accessibility,           |  patch shiny-updates
  javascript                         |
-------------------------------------+-------------------------------------
 With the new Shiny Updates, some error messages dispatched to the `aria-
 live` regions may contain HTML, e.g. links. For example:
 {{{
 Installation failed: An unexpected error occurred. Something may be wrong
 with WordPress.org or this server’s configuration. If you continue
 to have problems, please try the <a
 href="https://wordpress.org/support/">support forums</a>.
 }}}

 Though the message gets inserted in the aria live region as a text string,
 and thus it should be safe, having screen readers read out "less than ...
 href equal http slash slash etc. ... greater than support forums ..." or
 something like that is far from ideal:

 [[Image(https://cldup.com/5sUQsA3p9B.jpg)]]

 Ideally, any HTML should be stripped out from the message string as
 already done in a couple of cases in `updates.js` for example `$( '<p />'
 ).html( message ).text()`.
 See also #35191.

 Side note: I'm not so sure error messages returned in a response should
 contain HTML in the first place. I can understand that, historically, they
 were meant to be injected as HTML, for example in the notices on top of
 the screen. But now that these messages are going to be used in different
 places and for different purposes maybe it's time to re-think them since
 there's the need to distinguish when a message is "plain text" or "rich
 text with HTML" (or maybe provide both versions in the response?).

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


More information about the wp-trac mailing list