MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / _escape

Method _escape

markdown/extensions/codehilite.py:103–109  ·  view source on GitHub ↗

basic html escaping

(self, txt)

Source from the content-addressed store, hash-verified

101 return highlight(self.src, lexer, formatter)
102
103 def _escape(self, txt):
104 """ basic html escaping """
105 txt = txt.replace('&', '&')
106 txt = txt.replace('<', '&lt;')
107 txt = txt.replace('>', '&gt;')
108 txt = txt.replace('"', '&quot;')
109 return txt
110
111 def _number(self, txt):
112 """ Use <ol> for line numbering """

Callers 1

hiliteMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected