From 65f3338df4cf546ffc876b6be2f49766ff3d986c Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Mon, 2 Jun 2025 09:35:12 +0500 Subject: [PATCH] core: auto expand outline & callout in search result --- packages/core/src/api/lookup.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/core/src/api/lookup.ts b/packages/core/src/api/lookup.ts index 7472b77f9..a32834560 100644 --- a/packages/core/src/api/lookup.ts +++ b/packages/core/src/api/lookup.ts @@ -804,6 +804,14 @@ function highlightHtmlContent(html: string, queries: string[]): string { // Add the tag with its attributes result += `<${name}`; for (const [key, value] of Object.entries(attributes)) { + // auto expand outline lists + if (name === "li" && key === "data-collapsed") continue; + // auto expand callouts + if (name === "div" && key === "class" && value?.includes("callout")) { + result += ` ${key}="callout"`; + continue; + } + result += ` ${key}="${value}"`; } result += ">";