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
|
||||
|
||||
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue