publish: amend snippets

This commit is contained in:
Matilde Park 2020-11-25 00:05:05 -05:00
parent 25a5090f6f
commit 059b52ea23
3 changed files with 9 additions and 7 deletions

View File

@ -112,7 +112,7 @@ export function getComments(node: GraphNode): GraphNode {
}
export function getSnippet(body: string) {
const start = body.slice(0, 400);
const start = body.slice(0, body.indexOf('\n', 2));
return start === body ? start : `${start}...`;
}

View File

@ -62,13 +62,15 @@ export function NotePreview(props: NotePreviewProps) {
return (
<Link to={url}>
<Col mb={4}>
<WrappedBox mb={1}><Text bold>{title}</Text></WrappedBox>
<WrappedBox mb={1} className="md">
<WrappedBox mb={1}><Text bold fontSize='0'>{title}</Text></WrappedBox>
<WrappedBox mb={1}>
<Text fontSize='14px'>
<ReactMarkdown
unwrapDisallowed
allowedTypes={["text", "root", "break", "paragraph"]}
source={snippet}
/>
</Text>
</WrappedBox>
<Box color="gray" display="flex">
<Box

View File

@ -187,7 +187,7 @@
color:var(--gray);
}
.md p {
.md {
line-height: 1.5;
}
.md code, .md pre {
@ -201,7 +201,7 @@
border-bottom-width: 1px;
}
md img {
.md img {
margin-bottom: 8px;
}