Don't match punctuation suffix when linkifying channels
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user