mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-12 17:47:08 +01:00
use html.escape instead of some self build functions
This commit is contained in:
parent
e3c1bde793
commit
073c3c8fed
2 changed files with 5 additions and 7 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import re
|
||||
from html import escape
|
||||
from io import BytesIO
|
||||
from io import StringIO
|
||||
|
||||
|
|
@ -198,12 +199,7 @@ class MailDocumentParser(DocumentParser):
|
|||
text = "\n".join([str(e) for e in text])
|
||||
if type(text) != str:
|
||||
text = str(text)
|
||||
text = text.replace("&", "&")
|
||||
text = text.replace("<", "<")
|
||||
text = text.replace(">", ">")
|
||||
text = text.replace(" ", " ")
|
||||
text = text.replace("'", "'")
|
||||
text = text.replace('"', """)
|
||||
text = escape(text)
|
||||
text = clean(text)
|
||||
text = linkify(text, parse_email=True)
|
||||
text = text.replace("\n", "<br>")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue