Skip to content

Commit

Permalink
fix: only look for whitespace at start to calculate indent
Browse files Browse the repository at this point in the history
  • Loading branch information
chelkyl committed Apr 26, 2024
1 parent c29a49b commit 21e92d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/astro-remote/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 21e92d9

Please sign in to comment.