mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Allow more common mimetypes
This commit is contained in:
@@ -8,7 +8,7 @@ DECLARE
|
||||
_website_id UUID := (_headers ->> 'x-website-id')::UUID;
|
||||
_mimetype TEXT := _headers ->> 'x-mimetype';
|
||||
_original_filename TEXT := _headers ->> 'x-original-filename';
|
||||
_allowed_mimetypes TEXT[] := ARRAY['image/png', 'image/jpeg', 'image/webp'];
|
||||
_allowed_mimetypes TEXT[] := ARRAY['image/png', 'image/jpeg', 'image/webp', 'image/avif', 'image/gif', 'image/svg+xml'];
|
||||
_max_file_size INT := 5 * 1024 * 1024;
|
||||
_has_access BOOLEAN;
|
||||
BEGIN
|
||||
|
||||
@@ -15,7 +15,14 @@ import type {
|
||||
LegalInformation
|
||||
} from "$lib/db-schema";
|
||||
|
||||
export const ALLOWED_MIME_TYPES = ["image/jpeg", "image/png", "image/webp"];
|
||||
export const ALLOWED_MIME_TYPES = [
|
||||
"image/jpeg",
|
||||
"image/png",
|
||||
"image/webp",
|
||||
"image/avif",
|
||||
"image/gif",
|
||||
"image/svg+xml"
|
||||
];
|
||||
|
||||
export const slugify = (string: string) => {
|
||||
return string
|
||||
@@ -24,8 +31,8 @@ export const slugify = (string: string) => {
|
||||
.toLowerCase() // Convert to lowercase
|
||||
.trim() // Trim leading and trailing whitespace
|
||||
.replace(/\s+/g, "-") // Replace spaces with hyphens
|
||||
.replace(/[^\w\-]+/g, "") // Remove non-word characters (except hyphens)
|
||||
.replace(/\-\-+/g, "-") // Replace multiple hyphens with single hyphen
|
||||
.replace(/[^\w-]+/g, "") // Remove non-word characters (except hyphens)
|
||||
.replace(/-+/g, "-") // Replace multiple hyphens with single hyphen
|
||||
.replace(/^-+/, "") // Remove leading hyphens
|
||||
.replace(/-+$/, ""); // Remove trailing hyphens
|
||||
};
|
||||
@@ -51,8 +58,8 @@ const createMarkdownParser = (showToc = true) => {
|
||||
);
|
||||
|
||||
const gfmHeadingId = ({ prefix = "", showToc = true } = {}) => {
|
||||
let headings: { text: string; level: number; id: string }[] = [];
|
||||
let sectionStack: { level: number; id: string }[] = [];
|
||||
const headings: { text: string; level: number; id: string }[] = [];
|
||||
const sectionStack: { level: number; id: string }[] = [];
|
||||
|
||||
return {
|
||||
renderer: {
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
const handlePaste = async (event: ClipboardEvent) => {
|
||||
const newContent = await handleImagePaste(event, data.API_BASE_PREFIX);
|
||||
|
||||
if (newContent) {
|
||||
previewContent = newContent;
|
||||
}
|
||||
|
||||
@@ -34,11 +34,13 @@
|
||||
let resources = $state({});
|
||||
|
||||
if (data.website.content_type === "Blog") {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { user, change_log, media, docs_category, ...restTables } = tables;
|
||||
resources = restTables;
|
||||
}
|
||||
|
||||
if (data.website.content_type === "Docs") {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { user, change_log, media, ...restTables } = tables;
|
||||
resources = restTables;
|
||||
}
|
||||
@@ -253,8 +255,8 @@
|
||||
margin-inline-start: auto;
|
||||
}
|
||||
|
||||
button[disabled] {
|
||||
opacity: 0.5;
|
||||
button:disabled {
|
||||
pointer-events: none;
|
||||
color: hsl(0 0% 50%);
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user