mirror of
https://github.com/Hopiu/python-markdown-oembed.git
synced 2026-03-16 22:10:24 +00:00
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:
parent
469e696a95
commit
c3a4466eca
2 changed files with 12 additions and 12 deletions
|
|
@ -2,10 +2,8 @@
|
||||||
from mdx_oembed.extension import OEmbedExtension
|
from mdx_oembed.extension import OEmbedExtension
|
||||||
|
|
||||||
|
|
||||||
VERSION = '0.1.4'
|
VERSION = '0.1.5'
|
||||||
|
|
||||||
|
|
||||||
def makeExtension(configs=None):
|
def makeExtension(**kwargs):
|
||||||
if isinstance(configs, list):
|
return OEmbedExtension(**kwargs)
|
||||||
configs = dict(configs)
|
|
||||||
return OEmbedExtension(configs=configs)
|
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,15 @@ AVAILABLE_ENDPOINTS = ENDPOINTS.keys()
|
||||||
|
|
||||||
class OEmbedExtension(Extension):
|
class OEmbedExtension(Extension):
|
||||||
|
|
||||||
config = {
|
def __init__(self, **kwargs):
|
||||||
'allowed_endpoints': [
|
self.config = {
|
||||||
AVAILABLE_ENDPOINTS,
|
'allowed_endpoints': [
|
||||||
"A list of oEmbed endpoints to allow. Possible values are "
|
AVAILABLE_ENDPOINTS,
|
||||||
"{}.".format(', '.join(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):
|
def extendMarkdown(self, md, md_globals):
|
||||||
self.oembed_consumer = self.prepare_oembed_consumer()
|
self.oembed_consumer = self.prepare_oembed_consumer()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue