mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 16:51:42 +03:00
Merge pull request #4635 from tomholford/fix/notebook-index-image-preview
landscape: NotebookPreview can render image posts
This commit is contained in:
commit
cb0973867f
@ -107,7 +107,9 @@ export function getComments(node: GraphNode): GraphNode {
|
||||
}
|
||||
|
||||
export function getSnippet(body: string) {
|
||||
const start = body.slice(0, body.indexOf('\n', 2));
|
||||
const newlineIdx = body.indexOf('\n', 2);
|
||||
const end = newlineIdx > -1 ? newlineIdx : body.length;
|
||||
const start = body.substr(0, end);
|
||||
|
||||
return (start === body || start.startsWith('![')) ? start : `${start}...`;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user