Linkify messages
This commit is contained in:
parent
78002c22ee
commit
2bb8f68f6f
5 changed files with 41 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
|||
import { html, Component } from "/lib/index.js";
|
||||
import linkify from "/lib/linkify.js";
|
||||
|
||||
function djb2(s) {
|
||||
var hash = 5381;
|
||||
|
@ -45,10 +46,10 @@ function LogLine(props) {
|
|||
var action = text.slice(actionPrefix.length, -1);
|
||||
|
||||
lineClass = "me-tell";
|
||||
content = html`* <${Nick} nick=${msg.prefix.name}/> ${action}`;
|
||||
content = html`* <${Nick} nick=${msg.prefix.name}/> ${linkify(action)}`;
|
||||
} else {
|
||||
lineClass = "talk";
|
||||
content = html`${"<"}<${Nick} nick=${msg.prefix.name}/>${">"} ${text}`;
|
||||
content = html`${"<"}<${Nick} nick=${msg.prefix.name}/>${">"} ${linkify(text)}`;
|
||||
}
|
||||
break;
|
||||
case "JOIN":
|
||||
|
@ -70,7 +71,7 @@ function LogLine(props) {
|
|||
case "TOPIC":
|
||||
var topic = msg.params[1];
|
||||
content = html`
|
||||
<${Nick} nick=${msg.prefix.name}/> changed the topic to: ${topic}
|
||||
<${Nick} nick=${msg.prefix.name}/> changed the topic to: ${linkify(topic)}
|
||||
`;
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue