respect newlines
This commit is contained in:
parent
f2c40ad416
commit
d4611fc8d8
@ -1,3 +1,5 @@
|
|||||||
|
<hr />
|
||||||
|
|
||||||
<footer class="p-8 text-center flex flex-wrap justify-center items-center gap-x-2 text-neutral-500">
|
<footer class="p-8 text-center flex flex-wrap justify-center items-center gap-x-2 text-neutral-500">
|
||||||
<span>
|
<span>
|
||||||
Built with love by <a class="underline" href="https://mcndt.dev" alt="blog">mcndt</a>
|
Built with love by <a class="underline" href="https://mcndt.dev" alt="blog">mcndt</a>
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
import Heading from '$lib/marked/renderers/Heading.svelte';
|
import Heading from '$lib/marked/renderers/Heading.svelte';
|
||||||
import List from '$lib/marked/renderers/List.svelte';
|
import List from '$lib/marked/renderers/List.svelte';
|
||||||
import InternalLink from '$lib/marked/renderers/InternalLink.svelte';
|
import InternalLink from '$lib/marked/renderers/InternalLink.svelte';
|
||||||
import tokenizer from '$lib/marked/tokenizer';
|
|
||||||
import { marked } from 'marked';
|
import { marked } from 'marked';
|
||||||
import extensions from '$lib/marked/extensions';
|
import extensions from '$lib/marked/extensions';
|
||||||
|
|
||||||
@ -12,7 +11,7 @@
|
|||||||
// @ts-ignore: typing mismatch
|
// @ts-ignore: typing mismatch
|
||||||
marked.use({ extensions: extensions });
|
marked.use({ extensions: extensions });
|
||||||
|
|
||||||
const options = marked.defaults;
|
const options = { ...marked.defaults, breaks: true };
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
@ -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;
|
|
@ -15,7 +15,9 @@
|
|||||||
<NavBarLink href="/install">Get plugin</NavBarLink>
|
<NavBarLink href="/install">Get plugin</NavBarLink>
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
<svelte:fragment slot="right">
|
<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">
|
<NavBarLink href="https://github.com/mcndt/obsidian-note-sharing">
|
||||||
<span class="h-7 text-black"><LogoGithub /></span>
|
<span class="h-7 text-black"><LogoGithub /></span>
|
||||||
</NavBarLink>
|
</NavBarLink>
|
||||||
@ -27,9 +29,8 @@
|
|||||||
|
|
||||||
<div class="container mx-auto max-w-4xl mx-auto mt-12 px-4 2xl:px-0 prose-neutral">
|
<div class="container mx-auto max-w-4xl mx-auto mt-12 px-4 2xl:px-0 prose-neutral">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
<div class="mt-12">
|
||||||
|
<Footer />
|
||||||
<div class="mt-12">
|
</div>
|
||||||
<Footer />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user