From ebc6ab04f1fa9da3a4f9774c6ad2626505166f5f Mon Sep 17 00:00:00 2001 From: Elliot Date: Wed, 9 Oct 2024 13:10:14 +0800 Subject: [PATCH 1/2] feat(rehype): support webp image format --- .changeset/gorgeous-eyes-begin.md | 5 +++++ packages/uniorg-rehype/src/org-to-hast.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/gorgeous-eyes-begin.md diff --git a/.changeset/gorgeous-eyes-begin.md b/.changeset/gorgeous-eyes-begin.md new file mode 100644 index 0000000..9517f23 --- /dev/null +++ b/.changeset/gorgeous-eyes-begin.md @@ -0,0 +1,5 @@ +--- +'uniorg-rehype': minor +--- + +Support WebP image format diff --git a/packages/uniorg-rehype/src/org-to-hast.ts b/packages/uniorg-rehype/src/org-to-hast.ts index 31d7abe..0472396 100644 --- a/packages/uniorg-rehype/src/org-to-hast.ts +++ b/packages/uniorg-rehype/src/org-to-hast.ts @@ -63,6 +63,7 @@ const defaultOptions: OrgToHastOptions = { 'ppm', 'pnm', 'svg', + 'webp', ], useSections: false, footnotesSection: (footnotes) => [hast('h1', {}, 'Footnotes:'), ...footnotes], From b48123a2f8347d6566922135d0e85adc0917de8d Mon Sep 17 00:00:00 2001 From: Oleksii Shmalko Date: Thu, 23 Jan 2025 21:04:22 +0200 Subject: [PATCH 2/2] feat(rehype): recognize avif as well --- .changeset/gorgeous-eyes-begin.md | 2 +- packages/uniorg-rehype/src/org-to-hast.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.changeset/gorgeous-eyes-begin.md b/.changeset/gorgeous-eyes-begin.md index 9517f23..498fffa 100644 --- a/.changeset/gorgeous-eyes-begin.md +++ b/.changeset/gorgeous-eyes-begin.md @@ -2,4 +2,4 @@ 'uniorg-rehype': minor --- -Support WebP image format +Recognize `.webp` and `.avif` extensions as images. diff --git a/packages/uniorg-rehype/src/org-to-hast.ts b/packages/uniorg-rehype/src/org-to-hast.ts index 0472396..f3d89ea 100644 --- a/packages/uniorg-rehype/src/org-to-hast.ts +++ b/packages/uniorg-rehype/src/org-to-hast.ts @@ -64,6 +64,7 @@ const defaultOptions: OrgToHastOptions = { 'pnm', 'svg', 'webp', + 'avif', ], useSections: false, footnotesSection: (footnotes) => [hast('h1', {}, 'Footnotes:'), ...footnotes],