mirror of
https://github.com/urbit/shrub.git
synced 2024-11-28 05:22:27 +03:00
publish: amend snippets
This commit is contained in:
parent
25a5090f6f
commit
059b52ea23
@ -106,13 +106,13 @@ export function getLatestCommentRevision(node: GraphNode): [number, Post] {
|
||||
export function getComments(node: GraphNode): GraphNode {
|
||||
const comments = node.children.get(bigInt(2));
|
||||
if(!comments) {
|
||||
return { post: buntPost(), children: new BigIntOrderedMap() }
|
||||
return { post: buntPost(), children: new BigIntOrderedMap() }
|
||||
}
|
||||
return comments;
|
||||
}
|
||||
|
||||
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}...`;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user