diff --git a/src/python/html_filter.py b/src/python/html_filter.py
index e582bed3..41c06f05 100644
--- a/src/python/html_filter.py
+++ b/src/python/html_filter.py
@@ -61,7 +61,7 @@ class HtmlFilter:
def filter(self, html: str, outgoing: bool = False) -> str:
- html = self._sanitizer.sanitize(html)
+ html = self._sanitizer.sanitize(html).rstrip("\n")
if outgoing:
return html