Skip to content

Commit 514c0c0

Browse files
authored
Fix preview (#187)
1 parent 0726ee1 commit 514c0c0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/Thumbnail.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import {BASE_PATH} from "./shared.js";
44

55
function removeEmptyLines(string) {
66
const [first, ...rest] = string.split("\n").filter((line) => line.trim() !== "");
7-
return first + rest.join("\n");
7+
// If the first line ends with <code>, the code is already in the first line.
8+
if (first.endsWith("<code>")) return first + rest.join("\n");
9+
return first + "\n" + rest.join("\n");
810
}
911

1012
export function Thumbnail({html, outputStartLine = null, snap = null}) {

0 commit comments

Comments
 (0)