parameters: (self, text)
return_statement: return re.sub(
              (r'(?!\s($|\S))\s' if self.inline else r'\s'),
              '&nbsp;',
              ''.join(
                  encode_table.get(c, c) for c in text
              )
          )
docstring: Format text to HTML.
docstring_summary: Format text to HTML.
docstring_tokens: Format text to HTML .
function: def html_encode(self, text):
          """Format text to HTML."""
          encode_table = {
              '&': '&amp;',
              '>': '&gt;',
              '<': '&lt;',
              '\t': ' ' * self.tab_size,
              '\n': ''
          }
  
          return re.sub(
              (r'(?!\s($|\S))\s' if self.inline else r'\s'),
              '&nbsp;',
              ''.join(
                  encode_table.get(c, c) for c in text
              )
          )
function_tokens: def html_encode ( self , text ) : encode_table = { '&' : '&amp;' , '>' : '&gt;' , '<' : '&lt;' , '\t' : ' ' * self . tab_size , '\n' : '' } return re . sub ( ( r'(?!\s($|\S))\s' if self . inline else r'\s' ) , '&nbsp;' , '' . join ( encode_table . get ( c , c ) for c in text ) )