respect newlines

This commit is contained in:
Maxime Cannoodt 2022-06-23 22:13:03 +02:00
parent f2c40ad416
commit d4611fc8d8
4 changed files with 9 additions and 24 deletions

View File

@ -1,3 +1,5 @@
<hr />
<footer class="p-8 text-center flex flex-wrap justify-center items-center gap-x-2 text-neutral-500">
<span>
Built with love by <a class="underline" href="https://mcndt.dev" alt="blog">mcndt</a>

View File

@ -3,7 +3,6 @@
import Heading from '$lib/marked/renderers/Heading.svelte';
import List from '$lib/marked/renderers/List.svelte';
import InternalLink from '$lib/marked/renderers/InternalLink.svelte';
import tokenizer from '$lib/marked/tokenizer';
import { marked } from 'marked';
import extensions from '$lib/marked/extensions';
@ -12,7 +11,7 @@
// @ts-ignore: typing mismatch
marked.use({ extensions: extensions });
const options = marked.defaults;
const options = { ...marked.defaults, breaks: true };
</script>
<div

View File

@ -1,17 +0,0 @@
// Override function
const tokenizer = {
// Obsidian [[internal links]]
link(src: string) {
const match = src.match(/\[\[([^\n]+?)]\]/);
if (match) {
return {
type: 'internal-link',
raw: match[0],
text: match[1].trim()
};
}
return false;
}
};
export default tokenizer;

View File

@ -15,7 +15,9 @@
<NavBarLink href="/install">Get plugin</NavBarLink>
</svelte:fragment>
<svelte:fragment slot="right">
<span>Dark mode</span>
<NavBarLink href="https://obsidian.md"
><span class="text-[#705dcf] font-bold">Get Obsidian</span></NavBarLink
>
<NavBarLink href="https://github.com/mcndt/obsidian-note-sharing">
<span class="h-7 text-black"><LogoGithub /></span>
</NavBarLink>
@ -27,9 +29,8 @@
<div class="container mx-auto max-w-4xl mx-auto mt-12 px-4 2xl:px-0 prose-neutral">
<slot />
</div>
<div class="mt-12">
<Footer />
<div class="mt-12">
<Footer />
</div>
</div>
</div>