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:
Abubakar Abid 2022-12-15 08:40:47 -06:00 committed by GitHub
parent c67af90663
commit 2ae718f6b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View File

@ -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)

View File

@ -1 +1 @@
3.13.1
3.13.2

View File

@ -3,6 +3,7 @@ altair
fastapi
ffmpy
markdown-it-py[linkify,plugins]
markupsafe
matplotlib
numpy
orjson