Skip to content

Instantly share code, notes, and snippets.

@yymm
Created November 11, 2015 04:35
Show Gist options
  • Save yymm/726df7f0e4ed48e54a06 to your computer and use it in GitHub Desktop.
Save yymm/726df7f0e4ed48e54a06 to your computer and use it in GitHub Desktop.
import markdown
from markdown import Extension
from markdown.postprocessors import Postprocessor
import re
import requests
GIST_RE = r"^http(?:s)?://gist\.github\.com/.+$"
class EmbedExtension(Extension):
def extendMarkdown(self, md, md_globals):
md.postprocessors.add('embed', EmbedPostprocesser(self), '>raw_html')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment