From 14805c1ad25563f8749a36400c1ab62c8e4ef9b1 Mon Sep 17 00:00:00 2001 From: Sean Hayes Date: Mon, 25 Jan 2016 14:03:55 -0800 Subject: [PATCH] Specify BeautifulSoup parser. --- django_mesh/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django_mesh/models.py b/django_mesh/models.py index 68334c7..bc87163 100644 --- a/django_mesh/models.py +++ b/django_mesh/models.py @@ -73,7 +73,7 @@ def render(self, *args, **kwargs): self.rendered_text = textile.textile(self.text) - soup = BeautifulSoup(self.rendered_text) + soup = BeautifulSoup(self.rendered_text, 'html.parser') matching_text_nodes = soup.find_all(text = re.compile(URL_REGEX)) @@ -98,7 +98,7 @@ def render(self, *args, **kwargs): else: matching_text_node.replace_with(plain_text) - soup = BeautifulSoup(soup.encode(formatter=None)) + soup = BeautifulSoup(soup.encode(formatter=None), 'html.parser') self.rendered_text = soup.encode(formatter=None).decode()