Skip to content

Instantly share code, notes, and snippets.

@jdkato
Last active February 18, 2019 00:02
Show Gist options
  • Select an option

  • Save jdkato/918296518c80611068baf021697337b5 to your computer and use it in GitHub Desktop.

Select an option

Save jdkato/918296518c80611068baf021697337b5 to your computer and use it in GitHub Desktop.
import mistune
def main(meta, content, classes=[]):
"""Adding classes to a `<p>`.
"""
html = mistune.markdown(content)
return html.replace("<p>", '<p class="{0}">'.format(" ".join(classes)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment