🐛 Fix img tag

This commit is contained in:
xtaodada 2023-08-23 17:57:49 +08:00
parent d6d592cdcf
commit 53b69b7c81
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
httpx==0.24.1 httpx==0.24.1
fastapi~=0.101.1 fastapi~=0.101.1
starlette~=0.31.0 starlette
uvicorn~=0.23.2 uvicorn~=0.23.2
pydantic pydantic
python-dotenv python-dotenv

View File

@ -46,7 +46,7 @@ def parse_tag(tag: Union[Tag, PageElement]) -> str:
if href and href.startswith("http"): if href and href.startswith("http"):
return f'<a href="{href}">{tag.get_text()}</a>' return f'<a href="{href}">{tag.get_text()}</a>'
elif tag.name == "img": elif tag.name == "img":
return f"<p>{str(tag)}</p>" return str(tag)
elif tag.name == "p": elif tag.name == "p":
t = tag.get_text() t = tag.get_text()
if not t: if not t: