Beispiel #1
0
 def handle_entityref(self, ref):
     if ref == 'nbsp':
         self.result += ' '
     else:
         self.result += '&%(ref)s' % locals()
         if entitydefs.has_key(ref):
             self.result += ';'
Beispiel #2
0
	def handle_entityref(self, name):
		""" Called whenever a entity is encountered.
		If entity is recognized, convert it to related value,
		otherwise, just record the stream value. """
		if entitydefs.has_key(name):
			self.handle_data(entitydefs[name])
		else:
			self.handle_data('&%s;'%name)
Beispiel #3
0
 def handle_entityref(self,name): 
     if self.courseGet :
         if name == 'nbsp':
                 self.names += ' '
         elif entitydefs.has_key(name):
             self.names += entitydefs[name]
         else:
             self.names += ' '
Beispiel #4
0
 def handle_entityref(self,name): 
     if self.noteGet :
         if(self.inNote):
             if name == 'nbsp':
                 f**k = self.names.pop() + ' '
             elif entitydefs.has_key(name):
                 f**k = self.names.pop() + entitydefs[name]
             else:
                 f**k = self.names.pop() + ' '
             self.names.append(f**k)
Beispiel #5
0
    def handle_entityref(self, ref):
        r"""
        INPUT:

        - ``ref`` - string

        EXAMPLES::

            sage: from sagenb.notebook.docHTMLProcessor import docutilsHTMLProcessor
            sage: p = docutilsHTMLProcessor()
            sage: p.all_pieces = 'a lot of stuff done '
            sage: p.temp_pieces = ['bunch ', 'of ', 'tmp ', 'strings']
            sage: p.keep_data = True
            sage: p.handle_entityref('160')
            sage: p.all_pieces
            'a lot of stuff done '
            sage: p.temp_pieces
            ['bunch ', 'of ', 'tmp ', 'strings', u'&160']
        """
        if self.keep_data:
            self.temp_pieces.append("&%(ref)s" % locals())
            if entitydefs.has_key(ref):
                self.temp_pieces.append(';')
Beispiel #6
0
 def handle_entityref(self , name):
     if entitydefs.has_key(name):
         self.handle_data(name)
     else :
         self.handle_data("&"+name )
 def handle_entityref(self,name):
     if entitydefs.has_key(name):
         self.handle_data(entitydefs[name])
def handle_entitydef(matchobj):
    key = matchobj.group(1)
    if entitydefs.has_key(key):
        return entitydefs[key]
    else:
        return matchobj.group(0)
Beispiel #9
0
 def handle_entityref(self, name):
     if entitydefs.has_key(name):
         self.handle_data(entitydefs[name])
     else:
         self.handle_data('&' + name + ';')
Beispiel #10
0
 def handle_entityref(self, name):
     if entitydefs.has_key(name):
         self.handle_data(entitydefs[name])
     else:
         self.handle_data("&" + name + ":")
Beispiel #11
0
 def handle_entityref(self, ref):
     if self.bodyQ:
         self.temp_pieces.append("&%(ref)s" % locals())
         if entitydefs.has_key(ref):
             self.temp_pieces.append(';')
Beispiel #12
0
	def handle_entityref(self, name):
		if entitydefs.has_key(name):
			print('ref.......', entitydefs[name])
Beispiel #13
0
 def handle_entityref(self, name):
     """ """
     x= ';' * entitydefs.has_key(name)
     self.result.append("&%s%s" % (name, x))
Beispiel #14
0
 def handle_entityref(self, name):
     """Process entity references using Python's entitydefs mapping."""
     if entitydefs.has_key(name):
         self.handle_data(entitydefs[name])
     else:
         self.handle_data('&' + name + ';')
Beispiel #15
0
	def handle_entityref(self, name):
		if entitydefs.has_key(name):
			self.handle_data(entitydefs[name])
		else:
			self.handle_data('&' + name + ';')
Beispiel #16
0
 def handle_entityref(self, ref):
     if self.bodyQ:
         self.temp_pieces.append("&%(ref)s" % locals())
         if entitydefs.has_key(ref):
             self.temp_pieces.append(';')
Beispiel #17
0
 def handle_entityref(self, name):
     """Process entity references using Python's entitydefs mapping."""
     if entitydefs.has_key(name):
         self.handle_data(entitydefs[name])
     else:
         self.handle_data('&' + name + ';')