Add nick-prefix and nick-suffix classes

I'm using gamja through IRCToday. I'd like to apply a userstyle to this
text, and in order to do that I need a CSS class.

Thought I'd try and get this upstreamed. If you don't want to support
this usecase, that's totally understandable.
This commit is contained in:
Markus Unterwaditzer 2024-11-24 16:54:29 +01:00
parent 62895d59ff
commit 7b9c2b6769

View file

@ -146,9 +146,10 @@ class LogLine extends Component {
lineClass = "talk"; lineClass = "talk";
let prefix = "<", suffix = ">"; let prefix = "<", suffix = ">";
if (msg.command === "NOTICE") { if (msg.command === "NOTICE") {
lineClass += " notice";
prefix = suffix = "-"; prefix = suffix = "-";
} }
content = html`${prefix}${createNick(msg.prefix.name)}${suffix} ${linkify(stripANSI(text), onChannelClick)}`; content = html`<span class="nick-prefix">${prefix}</span>${createNick(msg.prefix.name)}<span class="nick-suffix">${suffix}</span> ${linkify(stripANSI(text), onChannelClick)}`;
} }
let allowedPrefixes = server.statusMsg; let allowedPrefixes = server.statusMsg;