Improve handling for URLs composed of mixed character sets
This commit is contained in:
parent
e4b0901620
commit
ae2db9f09a
6 changed files with 185 additions and 1 deletions
|
@ -3,6 +3,7 @@ import React from 'react';
|
|||
import LinkifyIt from 'linkify-it';
|
||||
|
||||
import { RenderTextCallback } from '../../types/Util';
|
||||
import { isLinkSneaky } from '../../../js/modules/link_previews';
|
||||
|
||||
const linkify = LinkifyIt();
|
||||
|
||||
|
@ -49,7 +50,7 @@ export class Linkify extends React.Component<Props> {
|
|||
}
|
||||
|
||||
const { url, text: originalText } = match;
|
||||
if (SUPPORTED_PROTOCOLS.test(url)) {
|
||||
if (SUPPORTED_PROTOCOLS.test(url) && !isLinkSneaky(url)) {
|
||||
results.push(
|
||||
<a key={count++} href={url}>
|
||||
{originalText}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue