File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ def __init__(self, **kwargs):
2020 'yahoo_height' : ['351' , 'Height for Yahoo! videos' ],
2121 'youtube_width' : ['560' , 'Width for Youtube videos' ],
2222 'youtube_height' : ['315' , 'Height for Youtube videos' ],
23+ 'youtube_nocookie' : [False , 'Use youtube-nocookie.com instead of youtube.com' ]
2324 }
2425
2526 # Override defaults with user settings
@@ -97,7 +98,10 @@ def handleMatch(self, m):
9798class Youtube (markdown .inlinepatterns .Pattern ):
9899
99100 def handleMatch (self , m ):
100- url = '//www.youtube.com/embed/%s' % m .group ('youtubeid' )
101+ if self .ext .config ['youtube_nocookie' ][0 ]:
102+ url = '//www.youtube-nocookie.com/embed/%s' % m .group ('youtubeid' )
103+ else :
104+ url = '//www.youtube.com/embed/%s' % m .group ('youtubeid' )
101105 width = self .ext .config ['youtube_width' ][0 ]
102106 height = self .ext .config ['youtube_height' ][0 ]
103107 return render_iframe (url , width , height )
You can’t perform that action at this time.
0 commit comments