categories,18popup,clear.TextEditorSwap,GameCardHover #177

Merged
freakoverse merged 64 commits from staging into master 2024-12-24 19:44:30 +00:00
Showing only changes of commit a6ed390fad - Show all commits

View File

@ -6,7 +6,7 @@ export const youtubeDirective: DirectiveConfig = {
marker: '::', marker: '::',
renderer(token) { renderer(token) {
//https://www.youtube.com/embed/<VIDEO_ID> //https://www.youtube.com/embed/<VIDEO_ID>
//{#<VIDEO_ID>} //::youtube{#<VIDEO_ID>}
let vid: string = '' let vid: string = ''
if (token.attrs && token.meta.name === 'youtube') { if (token.attrs && token.meta.name === 'youtube') {
for (const attr in token.attrs) { for (const attr in token.attrs) {
@ -15,15 +15,12 @@ export const youtubeDirective: DirectiveConfig = {
attr.startsWith('#') attr.startsWith('#')
) { ) {
vid = attr.replace('#', '') vid = attr.replace('#', '')
console.log(vid)
} }
} }
} }
if (vid) { if (vid) {
return `<iframe width="560" height="315" src="https://www.youtube.com/embed/${vid}" title="${ return `<iframe width="560" height="315" src="https://www.youtube.com/embed/${vid}" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>`
token.text || ''
}" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>`
} }
return false return false