Uses library for html cleanup
This commit is contained in:
parent
58b23a74da
commit
7f78140015
6 changed files with 44 additions and 102 deletions
|
@ -16,9 +16,8 @@ from django.views.decorators.http import require_POST
|
|||
|
||||
from markdown import markdown
|
||||
from bookwyrm import forms, models
|
||||
from bookwyrm.sanitize_html import InputHtmlParser
|
||||
from bookwyrm.settings import DOMAIN
|
||||
from bookwyrm.utils import regex
|
||||
from bookwyrm.utils import regex, sanitizer
|
||||
from .helpers import handle_remote_webfinger, is_api_request
|
||||
from .helpers import load_date_in_user_tz_as_utc
|
||||
|
||||
|
@ -268,6 +267,4 @@ def to_markdown(content):
|
|||
content = format_links(content)
|
||||
content = markdown(content)
|
||||
# sanitize resulting html
|
||||
sanitizer = InputHtmlParser()
|
||||
sanitizer.feed(content)
|
||||
return sanitizer.get_output()
|
||||
return sanitizer.clean(content)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue