Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions apps/desktop/src/components/main/body/changelog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ function stripFrontmatter(content: string): string {
return content.trim();
}

function stripImageLine(content: string): string {
return content.replace(/^!\[.*?\]\(.*?\)\s*\n*/m, "");
function fixImageUrls(content: string): string {
return content.replace(
/!\[([^\]]*)\]\(\/api\/images\/([^)]+)\)/g,
"![$1](https://auth.hyprnote.com/storage/v1/object/public/public_images/$2)",
);
}

function addEmptyParagraphsBeforeHeaders(
Expand Down Expand Up @@ -188,7 +191,7 @@ function useChangelogContent(version: string) {

changelogFiles[key]()
.then((raw) => {
const markdown = stripImageLine(stripFrontmatter(raw as string));
const markdown = fixImageUrls(stripFrontmatter(raw as string));
const json = md2json(markdown);
setContent(addEmptyParagraphsBeforeHeaders(json));
setLoading(false);
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/routes/api/images.$.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createFileRoute } from "@tanstack/react-router";

const SUPABASE_STORAGE_URL =
"https://ijoptyyjrfqwaqhyxkxj.supabase.co/storage/v1/object/public/public_images";
"https://auth.hyprnote.com/storage/v1/object/public/public_images";

const SAFE_SEGMENT = /^[A-Za-z0-9._+-]+$/;

Expand Down
15 changes: 14 additions & 1 deletion packages/tiptap/src/styles/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,21 @@
margin-bottom: 0.25rem;
}

.tiptap-image-wrapper {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}

> .tiptap-image-wrapper:first-child {
padding-top: 0;
}

> .tiptap-image-wrapper:last-child {
padding-bottom: 0;
}

.tiptap-image {
max-width: 240px;
max-width: 100%;
height: auto;
display: block;
}
Expand Down
Loading