Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{format} parameter in oembed URL is not replaced by actual format (json) #26

Open
vlisivka opened this issue Jul 29, 2021 · 1 comment

Comments

@vlisivka
Copy link

vlisivka commented Jul 29, 2021

  • @remark-embedder/transformer-oembed version: 1.0.1
  • node version: v14.17.0
  • npm version: 6.14.13

Problem description:

This plugin doesn't replace {format} parameter in oembed URL.

Expected URL:

https://vimeo.com/api/oembed.json?URL

Actual URL:

https://vimeo.com/api/oembed.%7Bformat%7D?URL

Error message:

(node:169898) UnhandledPromiseRejectionWarning: FetchError: The following error occurred while processing `https://vimeo.com/66520064` with the remark-embedder transformer `@remark-embedder/transformer-oembed`:

invalid json response body at https://vimeo.com/api/oembed.%7Bformat%7D?url=https%3A%2F%2Fvimeo.com%2F66520064&maxwidth=640&maxheight=480&format=json reason: Unexpected token < in JSON at position 0
    at /home/vlisivka/workspace/vlisivka.github.io/node_modules/minipass-fetch/lib/body.js:77:31
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Object.getHTML (/home/vlisivka/workspace/vlisivka.github.io/node_modules/@remark-embedder/transformer-oembed/dist/index.js:87:18)
    at async /home/vlisivka/workspace/vlisivka.github.io/node_modules/@remark-embedder/core/dist/index.js:106:20
    at async Promise.all (index 8)
    at async /home/vlisivka/workspace/vlisivka.github.io/node_modules/@remark-embedder/core/dist/index.js:158:5

Suggested solution:

Replace {format} by json.

@kentcdodds
Copy link
Member

Hi @vlisivka,

Thanks for the issue. If you'd like to dig a little deeper into things and make a pull request that'd be great. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants