Skip to content

Commit

Permalink
fix: #28 badge number is large then popup result.
Browse files Browse the repository at this point in the history
Signed-off-by: EINDEX <[email protected]>
  • Loading branch information
EINDEX committed May 11, 2023
1 parent 61502d5 commit ed9b9d3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pages/logseq/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default class LogseqClient {
walkTokens: highlightTokens(query),
extensions: [logseqLinkExt(graphName, query)],
});
const html = marked.parse(this.tirmContent(content));
const html = marked.parse(this.tirmContent(content)).trim();
return html;
};

Expand Down Expand Up @@ -241,17 +241,19 @@ export default class LogseqClient {
): Promise<LogseqResponseType<LogseqSearchResult>> => {
const { name: graphName } = await this.getCurrentGraph();
const res = await this.find(query);
const blocks = await Promise.all(
const blocks = (await Promise.all(
res.map(async (item) => {
const content = this.format(item.content, graphName, query)
if(!content) return null;
return {
html: this.format(item.content, graphName, query),
html: content,
uuid: item.uuid,
page: await this.getPage({
id: item.page.id,
} as LogseqPageIdenity),
} as LogseqBlockType;
}),
);
)).filter((b)=>b);
return {
status: 200,
msg: 'success',
Expand Down

0 comments on commit ed9b9d3

Please sign in to comment.