diff --git a/lib/linkify.js b/lib/linkify.js index b4b44b3..4ad658e 100644 --- a/lib/linkify.js +++ b/lib/linkify.js @@ -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];