fix inline player not showing up broken from previous commit
This commit is contained in:
parent
c9fdaec997
commit
221ae5b821
1 changed files with 12 additions and 6 deletions
|
@ -40,14 +40,15 @@ function MarkdownLink(props: Props) {
|
|||
const protocolRegex = new RegExp('^(https?|lbry|mailto)+:', 'i');
|
||||
const protocol = href ? protocolRegex.exec(href) : null;
|
||||
|
||||
// Return plain text if no valid url
|
||||
// Return external link if protocol is http or https
|
||||
// Return local link if protocol is lbry uri
|
||||
if (!simpleLinks && protocol && protocol[0] === 'lbry:' && isURIValid(decodedUri)) {
|
||||
const linkUrlObject = new URL(decodedUri);
|
||||
let linkUrlObject;
|
||||
try {
|
||||
linkUrlObject = new URL(decodedUri);
|
||||
} catch (e) {}
|
||||
|
||||
let lbryUrlFromLink;
|
||||
if (linkUrlObject) {
|
||||
const linkDomain = linkUrlObject.host;
|
||||
const isKnownAppDomainLink = KNOWN_APP_DOMAINS.includes(linkDomain);
|
||||
let lbryUrlFromLink;
|
||||
if (isKnownAppDomainLink) {
|
||||
const linkPathname = decodeURIComponent(
|
||||
linkUrlObject.pathname.startsWith('//') ? linkUrlObject.pathname.slice(2) : linkUrlObject.pathname.slice(1)
|
||||
|
@ -58,7 +59,12 @@ function MarkdownLink(props: Props) {
|
|||
lbryUrlFromLink = possibleLbryUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Return plain text if no valid url
|
||||
// Return external link if protocol is http or https
|
||||
// Return local link if protocol is lbry uri
|
||||
if ((protocol && protocol[0] === 'lbry:' && isURIValid(decodedUri)) || lbryUrlFromLink) {
|
||||
element = (
|
||||
<ClaimLink
|
||||
uri={lbryUrlFromLink || decodedUri}
|
||||
|
|
Loading…
Reference in a new issue