jeffgeerling-com icon indicating copy to clipboard operation
jeffgeerling-com copied to clipboard

Blog teasers don't parse out YouTube video embeds correctly, looks bad

Open geerlingguy opened this issue 5 years ago • 4 comments

See: https://www.jeffgeerling.com/blog

Screen Shot 2020-05-29 at 7 10 30 PM

@mglaman found this, so credit to him... if you look at the blog page and one of the entries has a YouTube embed, it's all garbled. It should either display the embed, or drop it, not display a bunch of random CSS!

geerlingguy avatar May 30 '20 00:05 geerlingguy

There's, unfortunately, not much to go on here:

Screen Shot 2020-06-10 at 9 25 03 AM

I guess I could figure out a way to get something like Smart Trim working? Then use it as the formatter for the summary on Teasers?

geerlingguy avatar Jun 10 '20 14:06 geerlingguy

@geerlingguy I haven't looked at your code – but is the CSS being inlined into the body for videos? That's all I could imagine for the weird output.

mglaman avatar Jun 10 '20 22:06 mglaman

@mglaman Yes, that's exactly what's happening. I grab the embed code from http://embedresponsively.com — which tosses it into <style> tags. I could maybe put HTML comments around that?

geerlingguy avatar Jun 11 '20 21:06 geerlingguy

Ah, so it is intended to be embedded as part of the blog content. I think the only workaround is to add that kind of CSS to your site's theme, or manually set the teaser to not include the video.

mglaman avatar Jun 12 '20 16:06 mglaman