Skip to content

Commit

Permalink
Merge pull request #1955 from warrickct/link-message-validation-fix
Browse files Browse the repository at this point in the history
Removing at regex test preventing some urls from rendering as links.
  • Loading branch information
Bilb authored Oct 8, 2021
2 parents af12e2c + 5eba4a6 commit 19425c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ts/components/conversation/Linkify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ interface Props {
}

const SUPPORTED_PROTOCOLS = /^(http|https):/i;
const HAS_AT = /@/;

export class Linkify extends React.Component<Props> {
public static defaultProps: Partial<Props> = {
Expand Down Expand Up @@ -49,7 +48,8 @@ export class Linkify extends React.Component<Props> {
}

const { url, text: originalText } = match;
if (SUPPORTED_PROTOCOLS.test(url) && !isLinkSneaky(url) && !HAS_AT.test(url)) {
const isLink = SUPPORTED_PROTOCOLS.test(url) && !isLinkSneaky(url);
if (isLink) {
results.push(
<a key={count++} href={url} onClick={this.handleClick}>
{originalText}
Expand Down

0 comments on commit 19425c9

Please sign in to comment.