[wp-trac] [WordPress Trac] #14082: wp_nav_menu inserts newline char (carriage return) between <li>

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 15 20:13:36 UTC 2010


#14082: wp_nav_menu inserts newline char (carriage return) between <li>
--------------------------+-------------------------------------------------
 Reporter:  dmichalakos   |        Owner:                 
     Type:  defect (bug)  |       Status:  reopened       
 Priority:  normal        |    Milestone:  Awaiting Review
Component:  Menus         |      Version:  3.1            
 Severity:  normal        |   Resolution:                 
 Keywords:  close         |  
--------------------------+-------------------------------------------------

Comment(by WraithKenny):

 It's still fairly standard to have tabs, line-breaks, and other white
 space in-between LIs in markup (for readability), and horizontal shrink-
 wrapped menus are somewhat rare, (probably, in fact, due to the popularity
 of this style of markup). I mean to point this out as it's not WordPress,
 but rather the industry, that has established this practice.

 Having said that, the markup practices where implemented for human
 readability. Given that WordPress' output is machine written, and most
 developers read HTML source through a syntax filter of some sort (Firebug,
 DOM inspectors), then perhaps the practice is out-dated.

 If it is the case that an indented markup style is outdated then should a
 new coding standard be adopted with respects to HTML source formatting?
 (Preferably debated on the mailing list?)

 In the mean time, it can probably be solved by plugins ;-)

 These two plugins use minify (http://code.google.com/p/minify/) on HTML
 (strips out white-space):

  1. http://wordpress.org/extend/plugins/wp-minify/
  2. http://wordpress.org/extend/plugins/w3-total-cache/

 (Or role your own smaller, more specific plugin.)

 I haven't tested them, but they'll likely solve your concerns without
 changes to core.

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


More information about the wp-trac mailing list