fix broken indentation
This commit is contained in:
parent
4e1a164717
commit
793292d0ed
|
@ -3,7 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="%sveltekit.assets%/images/favicon.ico" />
|
<link rel="icon" href="%sveltekit.assets%/images/favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
%sveltekit.head%
|
%sveltekit.head%
|
||||||
</head>
|
</head>
|
||||||
<body class="w-full h-full min-h-full" data-sveltekit-preload-data="hover" data-theme="skeleton">
|
<body class="w-full h-full min-h-full" data-sveltekit-preload-data="hover" data-theme="skeleton">
|
||||||
|
|
|
@ -88,7 +88,7 @@
|
||||||
<!-- prettier-ignore -->
|
<!-- prettier-ignore -->
|
||||||
<div class="markdown text-xl max-w-[90ch] pb-24">{@html contents}</div>
|
<div class="markdown text-xl max-w-[90ch] pb-24">{@html contents}</div>
|
||||||
{:else}
|
{:else}
|
||||||
<pre class="pt-5 pb-24 w-full whitespace-pre-wrap" bind:this={codeRef} on:dblclick={() => selectAll()} ><code>{@html contents}</code></pre>
|
<pre class="pl-2 pt-5 pb-24 max-w-full break-words whitespace-pre-line" bind:this={codeRef} on:dblclick={() => selectAll()} ><code>{@html contents}</code></pre>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div class="fixed bottom-0 right-0 w-full md:w-auto">
|
<div class="fixed bottom-0 right-0 w-full md:w-auto">
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<ToolBox disableSave={true} disableCopy={true} on:new={() => goto('/')} />
|
<ToolBox disableSave={true} disableCopy={true} on:new={() => goto('/')} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pl-8 max-w-[100ch] pb-24">
|
<div class="pl-2 pr-2 max-w-[100ch] pb-24">
|
||||||
<h1 class="h1 mb-2">Paste69</h1>
|
<h1 class="h1 mb-2">Paste69</h1>
|
||||||
|
|
||||||
<p class="mb-4 mt-4">
|
<p class="mb-4 mt-4">
|
||||||
|
|
|
@ -29,14 +29,13 @@ export const highlight = (code: string, lang: string | undefined = undefined) =>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Plugin to add line numbers
|
|
||||||
hljs.addPlugin({
|
hljs.addPlugin({
|
||||||
'after:highlight': (result) => {
|
'after:highlight': (result) => {
|
||||||
const code = result.value.split('\n').map((line, index) => {
|
const code = result.value.split('\n').map((line, index) => {
|
||||||
const lineNumber = index + 1;
|
const lineNumber = index + 1;
|
||||||
const paddedLineNumber = String(lineNumber).padStart(5, ' ');
|
const paddedLineNumber = String(lineNumber).padStart(5, ' ');
|
||||||
|
|
||||||
return `<div class="flex flex-row items-start justify-start gap-8"><div class="text-gray-400 select-none shrink-0 min-w-14">${paddedLineNumber}</div><div class="">${line}</div></div>`;
|
return `<div class="flex flex-row items-start justify-start gap-8"><div class="text-gray-400 select-none shrink-0 min-w-14">${paddedLineNumber}</div><pre class="whitespace-pre-wrap">${line}</pre></div>`;
|
||||||
}).join('\n');
|
}).join('\n');
|
||||||
|
|
||||||
result.value = `<div class="flex flex-col">${code}</div>`
|
result.value = `<div class="flex flex-col">${code}</div>`
|
||||||
|
|
Loading…
Reference in New Issue