def preformatted(self, on): FormatterBase.preformatted(self, on) snip = '---%<' snip = snip + ('-' * (78 - len(snip))) if on: return '\n' + snip else: return snip + '\n'
def paragraph(self, on, id=None): FormatterBase.paragraph(self, on) if self._in_li: self._in_li = self._in_li + 1 attr = self._langAttr() if self.inline_edit_force_state is not None: self.inline_edit = self.inline_edit_force_state if self.inline_edit and on: attr = '%s id="%s"' % (attr, id or self.inline_edit_id()) result = ['<p%s>' % attr, '\n</p>'][not on] return '%s\n' % result
def __init__(self, request, **kw): FormatterBase.__init__(self, request, **kw) self._in_li = 0 self._in_code = 0 self._base_depth = 0 self._show_section_numbers = None self.name = 'text_html' self._preview = kw.get("preview", 0) self.inline_edit = False self.inline_edit_force_state = None self.edit_id = 0 self.printed_rule = False self.just_printed_heading = False self.printed_inline_edit_id = False self.in_list = 0 if not hasattr(request, '_fmt_hd_counters'): request._fmt_hd_counters = []
def paragraph(self, on): FormatterBase.paragraph(self, on) return ['\n', ''][not on]
def preformatted(self, on): FormatterBase.preformatted(self, on) return ['<pre>', '</pre>'][not on]