mirror of
https://github.com/urbit/shrub.git
synced 2025-01-01 17:16:47 +03:00
parent
487cb75313
commit
803cdba754
@ -1,5 +1,5 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Box, Text, Col } from '@tlon/indigo-react';
|
||||
import { Box, Text, Col, Anchor } from '@tlon/indigo-react';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import bigInt from 'big-integer';
|
||||
|
||||
@ -32,6 +32,14 @@ export function Note(props: NoteProps & RouteComponentProps) {
|
||||
const { notebook, note, contacts, ship, book, api, rootUrl, baseUrl, group } = props;
|
||||
const editCommentId = props.match.params.commentId;
|
||||
|
||||
const renderers = {
|
||||
link: ({ href, children }) => {
|
||||
return (
|
||||
<Anchor display="inline" target="_blank" href={href}>{children}</Anchor>
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
const deletePost = async () => {
|
||||
setDeleting(true);
|
||||
const indices = [note.post.index];
|
||||
@ -107,7 +115,7 @@ export function Note(props: NoteProps & RouteComponentProps) {
|
||||
</Box>
|
||||
</Col>
|
||||
<Box color="black" className="md" style={{ overflowWrap: 'break-word', overflow: 'hidden' }}>
|
||||
<ReactMarkdown source={body} linkTarget={'_blank'} />
|
||||
<ReactMarkdown source={body} linkTarget={'_blank'} renderers={renderers} />
|
||||
</Box>
|
||||
<NoteNavigation
|
||||
notebook={notebook}
|
||||
|
Loading…
Reference in New Issue
Block a user