Fix blockquote card layout: hard-break (trailing spaces) between name/topic/link so lines render on separate rows; v2.1.7
This commit is contained in:
parent
874e84af76
commit
efc68c6f06
3 changed files with 13 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
maubot: 0.1.0
|
||||
id: nl.roomsoverview
|
||||
version: 2.1.6
|
||||
version: 2.1.7
|
||||
license: MIT
|
||||
modules:
|
||||
- roomsoverview
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -327,6 +327,12 @@ class RoomsOverviewPlugin(Plugin):
|
|||
# Elke room wordt een blockquote-kaart: een afgebakend blok met
|
||||
# gekleurde kantlijn, naam + ledental als kop, omschrijving eronder
|
||||
# en onderaan de join-link.
|
||||
#
|
||||
# Regels binnen de kaart scheiden met HARD BREAKS (twee trailing
|
||||
# spaties), niet met een kale newline: mautrix rendert een soft
|
||||
# newline binnen een paragraaf als spatie, en dan plakken naam,
|
||||
# topic en link aan elkaar. Twee spaties voor \n geven <br /> in
|
||||
# de formatted_body (echte nieuwe regel in Element).
|
||||
link_target = alias if alias else room_id
|
||||
address = _escape_md(alias if alias else room_id)
|
||||
lines = []
|
||||
|
|
@ -337,9 +343,13 @@ class RoomsOverviewPlugin(Plugin):
|
|||
lines.append(meta)
|
||||
if topic:
|
||||
lines.append(_escape_md(topic))
|
||||
# Linktekst = volledige matrix.to URL (fragment mag rauw # en : bevatten)
|
||||
# Linktekst = full matrix.to URI (fragment mag rauw # en : bevatten)
|
||||
lines.append(f"[{address}](https://matrix.to/#/{link_target})")
|
||||
rooms_blocks.append("\n".join(f"> {l}" for l in lines))
|
||||
cards = []
|
||||
for i, ln in enumerate(lines):
|
||||
suffix = " " if i < len(lines) - 1 else ""
|
||||
cards.append(f"> {ln}{suffix}")
|
||||
rooms_blocks.append("\n".join(cards))
|
||||
|
||||
chunk_size = max(1, int(self.config.get("rooms_per_message", 50) or 50))
|
||||
chunks = [
|
||||
|
|
|
|||
Loading…
Reference in a new issue