[wp-trac] Re: [WordPress Trac] #1371: Allowing HTML in post titles

WordPress Trac wp-trac at lists.automattic.com
Wed May 30 15:44:32 GMT 2007


#1371: Allowing HTML in post titles
--------------------------------------+-------------------------------------
 Reporter:  MaThIbUs                  |        Owner:  MathiasBynens
     Type:  enhancement               |       Status:  reopened     
 Priority:  lowest                    |    Milestone:               
Component:  Template                  |      Version:  2.1          
 Severity:  minor                     |   Resolution:               
 Keywords:  dev-feedback 2nd-opinion  |  
--------------------------------------+-------------------------------------
Comment (by Otto42):

 Replying to [comment:19 ManxStef]:
 > Post titles aren't meant to have HTML?  Why not?  You are allowed to use
 HTML in each post's body but not its title?  That's rather arbitrarily
 restrictive, don't you think?

 No, it goes with the whole separation of content and style thing. HTML in
 the post body is a) restricted to certain privileged users and b) heavily
 filtered. It's one thing to allow body text to have tags like em and
 strong and such, but it's another to allow them in post titles and then
 have to deal with all the hassle of filtering them and dealing with the
 weird permalink issues that it would probably cause.

 > The case for allowing HTML in posts' titles is a strong one.  Primarily,
 allowing a post's title to contain HTML would be very useful and make
 WordPress more flexible.  Why anyone would be against this is beyond me.

 Because it makes no sense. If you want to style the post titles, then use
 the CSS file. That's what it's for. Unless you want to style each post
 title separately or in different colors or something, which seems like a
 bit of an edge case.

 > Most uses of the_title() when it comes to markup involve wrapping it in
 a heading element (h1,h2,h3,h4,h5,h6).  According to my reading of the
 XHTML 1.0 & 1.1 Specifications there are many valid child elements that
 are allowed inside heading elements, so the potential is definitely there.

 Then those elements should be in the template, not in the data. The data
 layer should be *just* the data, not the style as well. Presentation vs.
 content. HTML tags are only content in certain, very-limited, cases.

 If we heavily filter the title (perhaps with kses) and don't allow
 arbitrary code for  *any* user, and then always make the_title() and
 get_the_title() filter *ALL* HTML code out by default with only an option
 to display it if the theme allows it, then *maybe* your notion would work.

 But I'm still +1 for not ever allowing HTML unless you can show me a
 legitimate example of why it would be useful that is not completely
 arbitrary in nature. Just putting some title words in italics or using
 separate styling for each title doesn't strike me as reason enough to add
 all the extra filtering overhead and violating the content/presentation
 layer concept.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/1371#comment:20>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list