geerlingguy / jeffgeerling-com

Drupal Codebase for JeffGeerling.com
https://www.jeffgeerling.com
GNU General Public License v2.0
41 stars 2 forks source link

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

Open geerlingguy opened 4 years ago

geerlingguy commented 4 years ago

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 commented 4 years ago

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?

mglaman commented 4 years ago

@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.

geerlingguy commented 4 years ago

@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?

mglaman commented 4 years ago

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.