Пример #1
0
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()
Пример #2
0
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()
Пример #3
0
 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))
Пример #4
0
 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))