def render_preview(text, parser, component="post"): """Renders a preview text for the given text using the parser provided. """ tree = parse(text, parser, "%s-preview" % component) intro, body = split_intro(tree) if intro: return u'<div class="intro">%s</div>%s' % (intro.to_html(), body.to_html()) return body.to_html()
def render_preview(text, parser, component='post'): """Renders a preview text for the given text using the parser provided. """ tree = parse(text, parser, '%s-preview' % component) intro, body = split_intro(tree) if intro: return u'<div class="intro">%s</div>%s' % (intro.to_html(), body.to_html()) return body.to_html()
def _parse_text(self, text): from rezine.parsers import parse self.parser_data['intro'], self.parser_data['body'] = \ zeml.split_intro(parse(text, self.parser, self.parser_reason))