Lines Matching refs:txt
84 txt = self._escape(self.src)
86 txt = self._number(txt)
88 txt = '<div class="%s"><pre>%s</pre></div>\n'% \
89 (self.css_class, txt)
90 return txt
103 def _escape(self, txt):
105 txt = txt.replace('&', '&')
106 txt = txt.replace('<', '<')
107 txt = txt.replace('>', '>')
108 txt = txt.replace('"', '"')
109 return txt
111 def _number(self, txt):
114 txt = txt.replace('\t', ' '*TAB_LENGTH)
115 txt = txt.replace(" "*4, " ")
116 txt = txt.replace(" "*3, " ")
117 txt = txt.replace(" "*2, " ")
120 lines = txt.splitlines()
121 txt = '<div class="codehilite"><pre><ol>\n'
123 txt += '\t<li>%s</li>\n'% line
124 txt += '</ol></pre></div>\n'
125 return txt