diff --git a/apps/client/src/widgets/collections/presentation/model.spec.ts b/apps/client/src/widgets/collections/presentation/model.spec.ts index c63b00bad..7f63d8a42 100644 --- a/apps/client/src/widgets/collections/presentation/model.spec.ts +++ b/apps/client/src/widgets/collections/presentation/model.spec.ts @@ -30,7 +30,8 @@ describe("Presentation model", () => { children: [ { id: "slide4", - title: "Second-sub" + title: "Second-sub", + content: `

Go to First-sub.

`, } ] } @@ -68,6 +69,7 @@ describe("Presentation model", () => { it("rewrites links to other slides", () => { expect(data.slides[1].content.__html).toStrictEqual(`

Go to First slide.

`); + expect(data.slides[1].verticalSlides![0].content.__html).toStrictEqual(`

Go to First-sub.

`); }); it("doesn't rewrite links if they are not part of the slideshow", () => { diff --git a/apps/client/src/widgets/collections/presentation/model.ts b/apps/client/src/widgets/collections/presentation/model.ts index 769a8d6da..14bd30c4d 100644 --- a/apps/client/src/widgets/collections/presentation/model.ts +++ b/apps/client/src/widgets/collections/presentation/model.ts @@ -62,9 +62,12 @@ async function processContent(note: FNote): Promise { return { __html: $renderedContent.html() }; } -async function postProcessSlides(slides: PresentationSlideModel[]) { +async function postProcessSlides(slides: (PresentationSlideModel | PresentationSlideBaseModel)[]) { for (const slide of slides) { if (slide.type !== "text") continue; slide.content.__html = slide.content.__html.replaceAll(/href="[^"]*#root[a-zA-Z0-9_\/]*\/([a-zA-Z0-9_]+)[^"]*"/g, `href="#/$1"`); + if ("verticalSlides" in slide && slide.verticalSlides) { + postProcessSlides(slide.verticalSlides); + } } }