mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-27 01:40:20 +08:00
Remove jinja2>=3.0
dependencies and release gradio==3.13.2
(#2819)
* version * removed jinja2.html method * removed jinja2.html method * update version * version
This commit is contained in:
parent
c67af90663
commit
2ae718f6b7
@ -18,6 +18,7 @@ from typing import Any, Dict, List, Optional, Type
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import fastapi
|
||||
import markupsafe
|
||||
import orjson
|
||||
import pkg_resources
|
||||
from fastapi import Depends, FastAPI, HTTPException, WebSocket, status
|
||||
@ -31,7 +32,6 @@ from fastapi.responses import (
|
||||
from fastapi.security import OAuth2PasswordRequestForm
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from jinja2.exceptions import TemplateNotFound
|
||||
from jinja2.utils import htmlsafe_json_dumps
|
||||
from starlette.responses import RedirectResponse
|
||||
from starlette.websockets import WebSocketState
|
||||
|
||||
@ -73,7 +73,13 @@ class ORJSONResponse(JSONResponse):
|
||||
|
||||
|
||||
def toorjson(value):
|
||||
return htmlsafe_json_dumps(value, dumps=ORJSONResponse._render_str)
|
||||
return markupsafe.Markup(
|
||||
ORJSONResponse._render_str(value)
|
||||
.replace("<", "\\u003c")
|
||||
.replace(">", "\\u003e")
|
||||
.replace("&", "\\u0026")
|
||||
.replace("'", "\\u0027")
|
||||
)
|
||||
|
||||
|
||||
templates = Jinja2Templates(directory=STATIC_TEMPLATE_LIB)
|
||||
|
@ -1 +1 @@
|
||||
3.13.1
|
||||
3.13.2
|
||||
|
@ -3,6 +3,7 @@ altair
|
||||
fastapi
|
||||
ffmpy
|
||||
markdown-it-py[linkify,plugins]
|
||||
markupsafe
|
||||
matplotlib
|
||||
numpy
|
||||
orjson
|
||||
|
Loading…
Reference in New Issue
Block a user