Skip to content

Commit e8d0492

Browse files
committed
fix
1 parent b183cf1 commit e8d0492

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/site-kit/src/lib/markdown/renderer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,8 @@ async function convert_to_ts(js_code: string, indent = '', offset = '') {
544544
let start = jsdoc[0].getStart();
545545
let end = jsdoc[0].getEnd();
546546

547-
while (start > 0 && code.original[start] === '\t') start -= 1;
548-
if (code.original[start - 1] === '\n') start -= 1;
547+
while (start > 0 && code.original[start - 1] === '\t') start -= 1;
548+
while (start > 0 && code.original[start - 1] === '\n') start -= 1;
549549

550550
code.overwrite(start, end, '');
551551
}
@@ -574,7 +574,7 @@ async function convert_to_ts(js_code: string, indent = '', offset = '') {
574574
while (js_code[i] !== '\n') i += 1;
575575
i += 1;
576576

577-
code.appendLeft(i, import_statements + '\n');
577+
code.appendLeft(i, '\n' + import_statements + '\n');
578578
} else {
579579
code.prependLeft(0, offset + import_statements + '\n');
580580
}

0 commit comments

Comments
 (0)