def escape(string): """ Temporary wrapper around HTML escaping to allow using Div model during static png exports. """ from .io import state if state._html_escape: return _escape(string) else: return string
def escape(string): """ Temporary wrapper around HTML escaping to allow using Div model during static png exports. """ from .io import state if state._html_escape: if sys.version_info.major == 2: return quoteattr(string, html_escape_table)[1:-1] else: return _escape(string) else: return string
def _generate_html_string(self, tag): return _escape(self._generate_string(tag), quote=True)
def _code(S, doRepr=False): # convert a variable name or value to html if doRepr: S = repr(S) return "<code class='gmi'>" + _escape(str(S)) + "</code>"