forked from Kieran/snort
parent
3a3a625092
commit
36fc771535
@ -156,6 +156,10 @@ function transformParagraph({ body, tags, users }: TextFragment) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function transformText({ body, tags, users }: TextFragment) {
|
function transformText({ body, tags, users }: TextFragment) {
|
||||||
|
if(body === undefined)
|
||||||
|
{
|
||||||
|
debugger;
|
||||||
|
}
|
||||||
let fragments = extractMentions(body, tags, users);
|
let fragments = extractMentions(body, tags, users);
|
||||||
fragments = extractLinks(fragments);
|
fragments = extractLinks(fragments);
|
||||||
fragments = extractInvoices(fragments);
|
fragments = extractInvoices(fragments);
|
||||||
@ -180,9 +184,9 @@ export interface TextProps {
|
|||||||
export default function Text({ content, tags, users }: TextProps) {
|
export default function Text({ content, tags, users }: TextProps) {
|
||||||
const components = useMemo(() => {
|
const components = useMemo(() => {
|
||||||
return {
|
return {
|
||||||
p: (x: any) => transformParagraph({ body: x.children, tags, users }),
|
p: (x: any) => transformParagraph({ body: x.children ?? [], tags, users }),
|
||||||
a: (x: any) => transformHttpLink(x.href),
|
a: (x: any) => transformHttpLink(x.href),
|
||||||
li: (x: any) => transformLi({ body: x.children, tags, users }),
|
li: (x: any) => transformLi({ body: x.children ?? [], tags, users }),
|
||||||
};
|
};
|
||||||
}, [content]);
|
}, [content]);
|
||||||
return <ReactMarkdown className="text" components={components}>{content}</ReactMarkdown>
|
return <ReactMarkdown className="text" components={components}>{content}</ReactMarkdown>
|
||||||
|
Loading…
Reference in New Issue
Block a user