diff --git a/src/__tests__/utils.test.ts b/src/__tests__/utils.test.ts index 1d09e4e..3bb9ee9 100644 --- a/src/__tests__/utils.test.ts +++ b/src/__tests__/utils.test.ts @@ -14,11 +14,13 @@ describe("normalizeContent", () => { ); }); - it("strips embed macros", () => { + it("strips macros", () => { expect(normalizeContent("Before {{embed ((abc-123))}} after")).toBe( "Before after", ); expect(normalizeContent("{{embed [[Some Page]]}}")).toBe(""); + expect(normalizeContent("Results: {{query (property :type \"book\")}}")).toBe("Results:"); + expect(normalizeContent("{{renderer :todomaster}}")).toBe(""); }); it("strips markdown link URLs, keeps bracketed text", () => { diff --git a/src/utils.ts b/src/utils.ts index c4a4e10..dd8c400 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -8,8 +8,8 @@ export function normalizeContent(content: string): string { // Strip Logseq block references ((uuid)) text = text.replace(/\(\([0-9a-fA-F-]+\)\)/g, ""); - // Strip Logseq embed macros {{embed ...}} - text = text.replace(/\{\{embed\s[^}]*\}\}/g, ""); + // Strip Logseq macros {{embed ...}}, {{query ...}}, {{renderer ...}}, etc. + text = text.replace(/\{\{[^}]*\}\}/g, ""); // Strip raw URLs from images, but PRESERVE the alt text // ![Diagram of architecture](https://...) -> Diagram of architecture