diff --git a/.changeset/selfish-radios-talk.md b/.changeset/selfish-radios-talk.md new file mode 100644 index 0000000..7874be8 --- /dev/null +++ b/.changeset/selfish-radios-talk.md @@ -0,0 +1,5 @@ +--- +"astro-remote": patch +--- + +Fixes an issue with internal `getIndent` function used for spacing corrections for `Markdown` diff --git a/packages/astro-remote/lib/utils.ts b/packages/astro-remote/lib/utils.ts index d72a7e5..20ff43f 100644 --- a/packages/astro-remote/lib/utils.ts +++ b/packages/astro-remote/lib/utils.ts @@ -39,8 +39,8 @@ export function createComponentProxy( } function getIndent(ln: string): string { - if (ln.trim() === ln) return ""; - return ln.slice(0, ln.length - ln.trim().length); + if (ln.trimStart() === ln) return ""; + return ln.slice(0, ln.length - ln.trimStart().length); } export function dedent(str: string): string { diff --git a/packages/playground/src/pages/index.astro b/packages/playground/src/pages/index.astro index 728a4ef..dba53b1 100644 --- a/packages/playground/src/pages/index.astro +++ b/packages/playground/src/pages/index.astro @@ -14,6 +14,7 @@