def cdata(state, text, i, formats, user_data):
 name = state.tags[(-1)].name
 pat = cdata_close_pats[name]
 m = pat.search(text, i)
 fmt = formats[(u'title' if (name == u'title') else u'special')]
 if (m is None):
  return [((len(text) - i), fmt)]
 state.parse = IN_CLOSING_TAG
 num = (m.start() - i)
 add_tag_data(user_data, TagStart(m.start(), u'', name, True, True))
 return [(num, fmt), (2, formats[u'end_tag']), ((len(m.group()) - 2), formats[u'tag_name'])]

def cdata ( state , text , i , formats , user_data ) : name = state . tags [ ( - 1 ) ] . name pat = cdata_close_pats [ name ] m = pat . search ( text , i ) fmt = formats [ ( u'title' if ( name == u'title' ) else u'special' ) ] if ( m is None ) : return [ ( ( len ( text ) - i ) , fmt ) ] state . parse = IN_CLOSING_TAG num = ( m . start ( ) - i ) add_tag_data ( user_data , TagStart ( m . start ( ) , u'' , name , True , True ) ) return [ ( num , fmt ) , ( 2 , formats [ u'end_tag' ] ) , ( ( len ( m . group ( ) ) - 2 ) , formats [ u'tag_name' ] ) ]
cdata inside tags like <title> or <style> .