[wp-trac] [WordPress Trac] #10702: Support for complex nested shorttags

WordPress Trac wp-trac at lists.automattic.com
Sun Aug 30 11:47:42 UTC 2009


#10702: Support for complex nested shorttags
-------------------------+--------------------------------------------------
 Reporter:  pepijndevos  |       Owner:            
     Type:  enhancement  |      Status:  new       
 Priority:  normal       |   Milestone:  Unassigned
Component:  Editor       |     Version:            
 Severity:  normal       |    Keywords:            
-------------------------+--------------------------------------------------
 The documentations is misleading on this point.
 It is said that you can have nested shorttags by calling do_shorttag on
 the content.

 However the shorttag parser isn't really a parser, it's just a non-greedy
 regex of some sort. It does work for simple tags without content, but when
 we define a [div] tag, look at the following code:

 {{{
 [div]
     [div]
         test1
     [/div]
     [div]
         test2
     [/div]
 [/div]
 }}}

 Results is:

 {{{
 <div>
     <div>(tag without content)
     test1
 </div>
 <div>
     test2
     [/div](not parsed at all)
 </div>
 }}}

 I think that if you want to stop people from writing their own parsers you
 should include some decent parser with Wordpress, not a regex I could do
 myself.

 Workaround: Assign div2 and probably div3 and 4 to the same function, and
 use these for the nested tags. <--- very ugly!

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10702>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list