Skip to content

Commit 6e988f7

Browse files
committed
Add comment.
1 parent 39d0016 commit 6e988f7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

django_unicorn/components/unicorn_template_response.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ def render(self):
118118
frontend_context_variables_dict = orjson.loads(frontend_context_variables)
119119
checksum = generate_checksum(str(frontend_context_variables_dict))
120120

121+
# Use `html.parser` and not `lxml` because in testing it was no faster even with `cchardet`
122+
# despite https://thehftguy.com/2020/07/28/making-beautifulsoup-parsing-10-times-faster/
121123
soup = BeautifulSoup(content, features="html.parser")
122124
root_element = get_root_element(soup)
123125
root_element["unicorn:id"] = self.component.component_id

0 commit comments

Comments
 (0)