[wp-trac] [WordPress Trac] #13327: Post editor puts content through wpautop() before displaying it to users without JS enabled

WordPress Trac wp-trac at lists.automattic.com
Mon Jul 19 23:29:55 UTC 2010


#13327: Post editor puts content through wpautop() before displaying it to users
without JS enabled
--------------------------+-------------------------------------------------
 Reporter:  markjaquith   |       Owner:                 
     Type:  defect (bug)  |      Status:  new            
 Priority:  low           |   Milestone:  Awaiting Triage
Component:  Editor        |     Version:  3.0            
 Severity:  normal        |    Keywords:                 
--------------------------+-------------------------------------------------

Comment(by azaozz):

 Been thinking more about this: currently we output HTML for both cases, js
 and no-js and then hide the extra elements with CSS (the .hide-if-js,
 .hide-if-no-js classes).

 This is working well and is completely transparent for the user. The
 disadvantages are that we output more HTML code and that in certain cases
 we still need to know whether JS in the browser is disabled before we
 start the output like for this ticket or the horizontal folding of the
 admin menu.

 It seems we have two options:

  * Change the no-js mechanism to use a "session" type cookie, i.e. add a
 <noscript> redirect in the HTML header and when that is triggered, set a
 cookie that will expire when the browser is closed.
 {{{
 <head>
 <noscript><meta http-equiv=refresh content="0; url=..." /></noscript>
 }}}

 The main disadvantage of this method is that the <noscript> tag is invalid
 in the HTML head in XHTML 1.0. However this is widely used and seems to
 work properly in all current browsers (see Google Maps for example).

 From user prospective there will be no change when JS is enabled and only
 a very small delay in loading the first admin screen when it's disabled.
 In the back-end we can see that redirect, set a global or a constant, set
 the temporary cookie and stop outputting the <noscript> redirect (of
 course we will be checking for that cookie first).

  * Continue handling this on per-case basis. In that terms we would need
 to output two content textareas on the write/edit screen and hide the
 extra one with CSS:

 {{{
 <textarea id="content" name="content" class="hide-if-no-js"></textarea>

 <textarea id="content-nojs" name="content-nojs" class="hide-if-
 js"></textarea>
 }}}

 If JS is enabled we can empty the content of #content-nojs (or even remove
 it completely), then when saving the post we will look first whether
 `$_POST['content-nojs']` is not empty and copy that over
 `$_POST['content']`.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13327#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list