From 979ffb329a11b3e043e4193e92391018401a4207 Mon Sep 17 00:00:00 2001 From: Dan Moore Date: Fri, 9 Feb 2024 12:54:42 -0700 Subject: [PATCH] RemoteContent is picking up the next to last line incorrectly. (#2885) We should remove any comments on the next to last line, otherwise it will comment out anything below the remote content call incorrectly. See https://fusionauth.io/docs/sdks/react-sdk It should include a "Source Code" section per https://github.com/FusionAuth/fusionauth-site/blob/master/astro/src/content/docs/sdks/react-sdk.mdx But it doesn't. --- astro/src/components/RemoteContent.astro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/astro/src/components/RemoteContent.astro b/astro/src/components/RemoteContent.astro index 476d9357d2..9bc3140ed8 100644 --- a/astro/src/components/RemoteContent.astro +++ b/astro/src/components/RemoteContent.astro @@ -51,13 +51,16 @@ function selectTagged(content: string, tags: string): string { const lines = content.split("\n"); const startLine = lines.findIndex((line) => line.includes(`tag::${tags}`)); - const endLine = lines.findIndex((line) => line.includes(`end::${tags}`)); + const endLine = lines.findIndex((line) => line.includes(`end::${tags}`)) // remove trailing multi-line HTML comment if (startLine < lines.length - 1) { lines[startLine + 1] = lines[startLine + 1].replace('-->', ''); } + // remove preceding multi-line HTML comment + lines[endLine-1] = lines[endLine-1].replace('