diff --git a/CHANGELOG.md b/CHANGELOG.md index 87b4dbc6..81243f4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -83,6 +83,9 @@ and this project adheres to - When signing in a new account, correctly position it after the other existing ones without needing a restart +- Correctly handle room topics containing new lines, hard tabs or text inside + `<>` brackets + ## 0.5.0 ### Added diff --git a/src/backend/matrix_client.py b/src/backend/matrix_client.py index d9c3926d..b585bcf1 100644 --- a/src/backend/matrix_client.py +++ b/src/backend/matrix_client.py @@ -1276,7 +1276,9 @@ class MatrixClient(nio.AsyncClient): avatar_url = room.gen_avatar_url or "", plain_topic = room.topic or "", topic = HTML.filter( - room.topic or "", inline=True, room_id=room.room_id, + utils.plain2html(room.topic or ""), + inline = True, + room_id = room.room_id, ), inviter_id = inviter, inviter_name = room.user_name(inviter) if inviter else "", diff --git a/src/backend/nio_callbacks.py b/src/backend/nio_callbacks.py index 83ebd2a6..e7fbbb3c 100644 --- a/src/backend/nio_callbacks.py +++ b/src/backend/nio_callbacks.py @@ -451,7 +451,7 @@ class NioCallbacks: ) -> None: if ev.topic: topic = HTML_PROCESSOR.filter( - ev.topic, inline=True, room_id=room.room_id, + plain2html(ev.topic), inline=True, room_id=room.room_id, ) co = f"%1 changed the room's topic to \"{topic}\"" else: