def compile(self, repl=None): input_summary = self.summary input_content = self.content if repl is not None: input_summary = multi_replace(input_summary, repl) input_content = multi_replace(input_content, repl) self.summary_html = markup_to_html(self.format, input_summary) self.content_html = markup_to_html(self.format, input_content)
def upgrade(app): """ data migration to update the Tag.count fields """ db_session = DB(app.config['DATABASE']).get_session() existing_posts = db_session.query(Post).all() for post in existing_posts: post.summary_html = markup_to_html(post.format, post.summary) post.content_html = markup_to_html(post.format, post.content) db_session.commit()
def tf_to_html(content, format): """Convert input to html""" return markup_to_html(format, content)