diff --git a/backend/open_webui/routers/utils.py b/backend/open_webui/routers/utils.py index 92caf5fee9..04047fd47b 100644 --- a/backend/open_webui/routers/utils.py +++ b/backend/open_webui/routers/utils.py @@ -3,7 +3,6 @@ from __future__ import annotations import logging import black -import markdown from fastapi import APIRouter, Depends, HTTPException, Request, Response, status from open_webui.config import DATA_DIR, ENABLE_ADMIN_EXPORT from open_webui.constants import ERROR_MESSAGES @@ -73,15 +72,6 @@ async def execute_code(request: Request, form_data: CodeForm, user=Depends(get_v ) -class MarkdownForm(BaseModel): - md: str - - -@router.post('/markdown') -async def get_html_from_markdown(form_data: MarkdownForm, user=Depends(get_verified_user)): - return {'html': markdown.markdown(form_data.md)} - - class ChatForm(BaseModel): title: str messages: list[dict] diff --git a/src/lib/apis/utils/index.ts b/src/lib/apis/utils/index.ts index e5fea091eb..f38f10ae0b 100644 --- a/src/lib/apis/utils/index.ts +++ b/src/lib/apis/utils/index.ts @@ -122,32 +122,6 @@ export const downloadChatAsPDF = async (token: string, title: string, messages: return blob; }; -export const getHTMLFromMarkdown = async (token: string, md: string) => { - let error = null; - - const res = await fetch(`${WEBUI_API_BASE_URL}/utils/markdown`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - Authorization: `Bearer ${token}` - }, - body: JSON.stringify({ - md: md - }) - }) - .then(async (res) => { - if (!res.ok) throw await res.json(); - return res.json(); - }) - .catch((err) => { - console.error(err); - error = err; - return null; - }); - - return res.html; -}; - export const downloadDatabase = async (token: string) => { let error = null;