#NEWLINE# def visit_literal( self , node ) : #NEWLINE# #INDENT# html5_known_roles = ( 'code' , 'kbd' , 'samp' , 'var' ) #NEWLINE# classes = node . get ( 'classes' , [ ] ) #NEWLINE# if ( not classes ) : #NEWLINE# #INDENT# self . body . append ( self . starttag ( node , 'code' , '' ) ) #NEWLINE# self . context . append ( '</code>' ) #NEWLINE# return #NEWLINE# #UNINDENT# for cls in classes : #NEWLINE# #INDENT# if ( cls in html5_known_roles ) : #NEWLINE# #INDENT# node [ 'classes' ] = [ c for c in classes if ( c != cls ) ] #NEWLINE# self . body . append ( self . starttag ( node , cls , '' ) ) #NEWLINE# self . context . append ( ( '</%s>' % cls ) ) #NEWLINE# return #NEWLINE# #UNINDENT# #UNINDENT# self . body . append ( self . starttag ( node , 'span' , '' , CLASS = 'literal' ) ) #NEWLINE# text = node . astext ( ) #NEWLINE# for token in self . words_and_spaces . findall ( text ) : #NEWLINE# #INDENT# if token . strip ( ) : #NEWLINE# #INDENT# if self . sollbruchstelle . search ( token ) : #NEWLINE# #INDENT# self . body . append ( ( '<span class="pre">%s</span>' % self . encode ( token ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . body . append ( self . encode ( token ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( token in ( '\n' , ' ' ) ) : #NEWLINE# #INDENT# self . body . append ( token ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . body . append ( ( ( '&nbsp;' * ( len ( token ) - 1 ) ) + ' ' ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . body . append ( '</span>' ) #NEWLINE# raise nodes . SkipNode