def get_html( mapper: Type[sa.orm.Mapper], connection: sa.engine.Connection, target: sa.orm.Mapper ) -> None: if target.ptype == "html": target.html = target.content else: target.html = markdown(target.content)
def render_markdown(mapper: Type[sa.orm.Mapper], connection: sa.engine.Connection, target: sa.orm.Mapper) -> None: if not target.slug: target.slug = slugify(target.title) if not target.date: target.date = datetime.utcnow() target.html = markdown(target.content) target.toc = markdown.renderer.render_toc() target.url = "/{}/{}".format(target.date.strftime("%Y/%m-%d"), target.slug)
def comment_html(mapper: Type[sa.orm.Mapper], connection: sa.engine.Connection, target: sa.orm.Mapper) -> None: # Use a more strict version of markdown parser for untrusted source. target.html = strict_markdown(target.content)
def comment_html( mapper: Type[sa.orm.Mapper], connection: sa.engine.Connection, target: sa.orm.Mapper ) -> None: target.html = markdown(target.content)