Clean up SoundCloud embeds

This commit is contained in:
daniel-j 2017-06-07 09:53:28 +02:00
parent ea1b9df73f
commit 8c61e1b478

View file

@ -61,6 +61,13 @@ export function cleanMarkup (html) {
}
}
let matchSoundCloud = /<div data-controller="oembed" class="oembed" data-url="(.*?)" .+?<\/div>/g
html = html.replace(matchSoundCloud, (match, url) => {
return render(m('.soundcloud.leftalign', [
'SoundCloud song ', m('a', {href: url, rel: 'nofollow'}, url.replace('https://soundcloud.com', ''))
]))
})
if (cache.size === 0) {
continueParsing()
} else {
@ -99,10 +106,10 @@ export function cleanMarkup (html) {
return ''
}
return render(m('figure.youtube', [
m('a', {href: youtubeUrl},
m('a', {href: youtubeUrl, rel: 'nofollow'},
m('img', {src: thumbnail, alt: title})
),
m('figcaption', m('a', {href: youtubeUrl}, caption))
m('figcaption', m('a', {href: youtubeUrl, rel: 'nofollow'}, caption))
]))
}