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