Fix handling topics containing \n, \t or <text>
This commit is contained in:
parent
6772f14c24
commit
a6529b040c
|
@ -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
|
||||
|
|
|
@ -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 "",
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user