#NEWLINE# def handleAttributes( text , parent ) : #NEWLINE# #INDENT# 'Set values of an element based on attribute definitions ({@id=123}).' #NEWLINE# def attributeCallback( match ) : #NEWLINE# #INDENT# parent . set ( match . group ( 1 ) , match . group ( 2 ) . replace ( '\n' , ' ' ) ) #NEWLINE# #UNINDENT# return ATTR_RE . sub ( attributeCallback , parent )