// @flow import * as React from 'react'; import remark from 'remark'; import remarkAttr from 'remark-attr'; import remarkStrip from 'strip-markdown'; import remarkEmoji from 'remark-emoji'; import remarkBreaks from 'remark-breaks'; import reactRenderer from 'remark-react'; import ExternalLink from 'component/externalLink'; import defaultSchema from 'hast-util-sanitize/lib/github.json'; import { formatedLinks, inlineLinks } from 'util/remark-lbry'; import { Link } from 'react-router-dom'; import { formatLbryUrlForWeb } from 'util/url'; import EmbedPlayButton from 'component/embedPlayButton'; type SimpleTextProps = { children?: React.Node, }; type SimpleLinkProps = { href?: string, title?: string, children?: React.Node, noDataStore?: boolean, }; type MarkdownProps = { strip?: boolean, content: ?string, promptLinks?: boolean, noDataStore?: boolean, }; const SimpleText = (props: SimpleTextProps) => { return {props.children}; }; const SimpleLink = (props: SimpleLinkProps) => { const { title, children } = props; const { href, noDataStore } = props; if (!href) { return children || null; } if (!href.startsWith('lbry://')) { return ( {children} ); } const [uri, search] = href.split('?'); const urlParams = new URLSearchParams(search); const embed = urlParams.get('embed'); if (embed) { // Decode this since users might just copy it from the url bar const decodedUri = decodeURI(uri); return noDataStore ? (
{decodedUri}