delucis / astro-embed

Low-JavaScript embed components for Astro websites
https://astro-embed.netlify.app
MIT License
166 stars 24 forks source link

Regression in link embedding since 0.7.0 #120

Closed nathanchere closed 2 months ago

nathanchere commented 2 months ago

I previously used astro-embed-integration for things like YouTube embeds and it was fine.

But after upgrading to 0.7 it has started forcibly turning LinkedIn URLs in .mdx to embeds. Even if I try wrapping the URL in an explicit tag like [The Link](https://linkedin.com/in/somelink), it just ignores that and replaces with an embed.

I removed the package and added astro-embed instead which appears to be the same repository, just not the @astro-community package.

I tried adding the LinkPreview override to astro config like as follows:

import embeds from 'astro-embed/integration';

export default defineConfig({
  integrations: [
    embeds({
      LinkPreview: false
    }),
   //...

but it ignores this too and still hijacks the LinkedIn URLs in markdown files.

delucis commented 2 months ago

Hi @nathanchere! Looks like the config object you’re passing is missing the services key. It should instead be:

    embeds({
      services: {
        LinkPreview: false,
      },
    }),

Regarding a Markdown link being embedded, i.e. [a link](url), that does seem like a bug — the intention is to convert only plain URLs. I don’t think that’s a regression — pretty sure we’ve probably never handled this correctly — but would still be nice to improve.

nathanchere commented 1 month ago

Confirmed working as expected in 0.7.2, thanks so much for the prompt solution!