Merge pull request #3 from Hopiu/patch-3

Update extension.py
This commit is contained in:
W.A.Flozart 2022-08-08 13:19:31 +02:00 committed by GitHub
commit cb46ae8f8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,7 @@ class OEmbedExtension(Extension):
self.oembed_consumer = self.prepare_oembed_consumer() self.oembed_consumer = self.prepare_oembed_consumer()
link_pattern = OEmbedLinkPattern(OEMBED_LINK_RE, md, link_pattern = OEmbedLinkPattern(OEMBED_LINK_RE, md,
self.oembed_consumer) self.oembed_consumer)
md.inlinePatterns.add('oembed_link', link_pattern, '<image_link') md.inlinePatterns.register(link_pattern, 'oembed_link', 135)
def prepare_oembed_consumer(self): def prepare_oembed_consumer(self):
allowed_endpoints = self.getConfig('allowed_endpoints', DEFAULT_ENDPOINTS) allowed_endpoints = self.getConfig('allowed_endpoints', DEFAULT_ENDPOINTS)