code: def escape_html(text, escape_slash=False):
      
      byte_str = text.encode('utf-8')
      ob = lib.hoedown_buffer_new(OUNIT)
      lib.hoedown_escape_html(ob, byte_str, len(byte_str), int(escape_slash))
  
      try:
          return to_string(ob)
      finally:
          lib.hoedown_buffer_free(ob)
docs: Binding for Hoedown's HTML escaping function.
  
      The implementation is inspired by the OWASP XSS Prevention recommendations:
  
      .. code-block:: none
  
          & --> &amp;
          < --> &lt;
          > --> &gt;
          " --> &quot;
          ' --> &#x27;
          / --> &#x2F;  when escape_slash is set to True
  
      .. versionadded:: 2.1.0