Reconcile with Markdown 2.6

Updated the initialization of OEmbedExtension to be compatible with
Markdown 2.6. See https://pythonhosted.org/Markdown/release-2.6.html
This commit is contained in:
Sami Turcotte 2015-04-02 03:47:33 -04:00
parent 469e696a95
commit c3a4466eca
2 changed files with 12 additions and 12 deletions

View file

@ -2,10 +2,8 @@
from mdx_oembed.extension import OEmbedExtension
VERSION = '0.1.4'
VERSION = '0.1.5'
def makeExtension(configs=None):
if isinstance(configs, list):
configs = dict(configs)
return OEmbedExtension(configs=configs)
def makeExtension(**kwargs):
return OEmbedExtension(**kwargs)

View file

@ -10,13 +10,15 @@ AVAILABLE_ENDPOINTS = ENDPOINTS.keys()
class OEmbedExtension(Extension):
config = {
'allowed_endpoints': [
AVAILABLE_ENDPOINTS,
"A list of oEmbed endpoints to allow. Possible values are "
"{}.".format(', '.join(AVAILABLE_ENDPOINTS)),
],
}
def __init__(self, **kwargs):
self.config = {
'allowed_endpoints': [
AVAILABLE_ENDPOINTS,
"A list of oEmbed endpoints to allow. Possible values are "
"{}.".format(', '.join(AVAILABLE_ENDPOINTS)),
],
}
super(OEmbedExtension, self).__init__(**kwargs)
def extendMarkdown(self, md, md_globals):
self.oembed_consumer = self.prepare_oembed_consumer()