forked from CringeStudios/gamja
Don't match punctuation suffix when linkifying channels
This commit is contained in:
parent
403d7ec7f7
commit
a419e660c0
@ -1,11 +1,11 @@
|
||||
import { anchorme, html } from "./index.js";
|
||||
|
||||
function linkifyChannel(text, transformChannel) {
|
||||
var children = [];
|
||||
// TODO: Don't match punctuation
|
||||
const channelRegex = /(?:^|\s)(#[^\s]+)/gid;
|
||||
let match;
|
||||
// Don't match punctuation at the end of the channel name
|
||||
const channelRegex = /(?:^|\s)(#[^\s]+[^\s.?!…():;])/gid;
|
||||
|
||||
var children = [];
|
||||
var match;
|
||||
var last = 0;
|
||||
while ((match = channelRegex.exec(text)) !== null) {
|
||||
var channel = match[1];
|
||||
|
Loading…
x
Reference in New Issue
Block a user