Skip to content

Commit

Permalink
fix: add .gif to raw imgur links
Browse files Browse the repository at this point in the history
  • Loading branch information
hatton committed Jul 22, 2022
1 parent 840b302 commit c263872
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"//chalk@4": "also ESM related problem",
"dependencies": {
"@notionhq/client": "^1.0.4",
"chalk": "^5.0.1",
"chalk": "^4.1.2",
"commander": "^9.2.0",
"file-type": "16.5.1",
"fs-extra": "^10.1.0",
Expand Down
8 changes: 7 additions & 1 deletion src/DocusaurusTweaks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,16 @@ function notionEmbedsToMDX(input: string): {
import: `import ReactPlayer from "react-player";`,
output: `<ReactPlayer controls url="$1" />`,
};
const gif = {
/* GifPlayer worked with some sources but not imgur which is the most important for my project. It would just give CORS errors.
And it is unmaintained. So let's just let the raw gif link do its thing.
const gif = {
import: `import GifPlayer from "react-gif-player";`,
output: `<GifPlayer gif="$1" />`,
};
*/ const gif = {
import: "",
output: `![]($1.gif)`, // note: imgur links to gifs need a .gif at the end, but the url they give you doesn't have one.
};
const embeds = {
youtube: {
regex: /\[.*\]\((.*youtube\.com\/watch.*)\)/gm, //youtube.com/watch
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2447,7 +2447,7 @@ chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2:
ansi-styles "^4.1.0"
supports-color "^7.1.0"

chalk@^5.0.0, chalk@^5.0.1:
chalk@^5.0.0:
version "5.0.1"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.0.1.tgz#ca57d71e82bb534a296df63bbacc4a1c22b2a4b6"
integrity sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==
Expand Down

0 comments on commit c263872

Please sign in to comment.