mirror of
https://github.com/outline/outline.git
synced 2026-11-29 00:29:36 +03:00
perf: Avoid unneccessary toMarkdown call in document presenter
This commit is contained in:
1 parent
1c527c97a7
commit
058e413a6e
1 file changed
+5
-2
@@ -39,7 +39,10 @@ async function presentDocument(
|
||||
: undefined
|
||||
);
|
||||
|
||||
const text = DocumentHelper.toMarkdown(data);
|
||||
const text =
|
||||
!asData || options?.includeText
|
||||
? DocumentHelper.toMarkdown(data)
|
||||
: undefined;
|
||||
|
||||
const res: Record<string, any> = {
|
||||
id: document.id,
|
||||
@@ -47,7 +50,7 @@ async function presentDocument(
|
||||
urlId: document.urlId,
|
||||
title: document.title,
|
||||
data: asData || options?.includeData ? data : undefined,
|
||||
text: !asData || options?.includeText ? text : undefined,
|
||||
text,
|
||||
icon: document.icon,
|
||||
color: document.color,
|
||||
tasks: document.tasks,
|
||||
|
||||
Reference in new issue
Block a user