fix iframe lbry links in markdown posts

This commit is contained in:
Sean Yesmunt 2020-10-23 13:14:12 -04:00
parent 33bf50e91b
commit 5a1eecfc4b

View file

@ -53,7 +53,10 @@ function MarkdownLink(props: Props) {
const linkPathname = decodeURIComponent(
linkUrlObject.pathname.startsWith('//') ? linkUrlObject.pathname.slice(2) : linkUrlObject.pathname.slice(1)
);
const possibleLbryUrl = `lbry://${linkPathname.replace(/:/g, '#')}`;
const linkPathPlusHash = linkPathname + linkUrlObject.hash;
const possibleLbryUrl = `lbry://${linkPathPlusHash.replace(/:/g, '#')}`;
const lbryLinkIsValid = isURIValid(possibleLbryUrl);
if (lbryLinkIsValid) {
lbryUrlFromLink = possibleLbryUrl;