[buddypress-trac] [BuddyPress] #1660: bp_create_excerpt can split html tags

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Thu Jan 21 23:03:41 UTC 2010


#1660: bp_create_excerpt can split html tags
-------------------------------------+--------------------------------------
Reporter:  junsuijin                 |       Owner:  junsuijin
    Type:  defect                    |      Status:  new      
Priority:  major                     |   Milestone:  1.2      
Keywords:  has-patch, needs testing  |  
-------------------------------------+--------------------------------------
 Because exploding content with a space delimiter can split html tags like
 'a' or 'img' and cut them at the 55 word-limit, creating ugly half-codes
 at the end of excerpts, a preg_split should be used to count <a...</a>,
 <img ... >, <object...</object> and other inline elements like span etc as
 single words. I have tested this code extensively for trimming unstripped
 blog post excerpts but have not tested with BuddyPress specifically.
 Decisions can also be made as to whether to even allow <object>s into the
 excerpts (I haven't looked but perhaps these tags get removed at some
 other point). This code does not handle iframes. If desired I can use an
 'x' flag on the regex and attempt to make it more readable.

-- 
Ticket URL: <https://trac.buddypress.org/ticket/1660>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list