diff --git a/webapp/src/lib/components/MarkdownRenderer.svelte b/webapp/src/lib/components/MarkdownRenderer.svelte index 34e747c..0f3f6a1 100644 --- a/webapp/src/lib/components/MarkdownRenderer.svelte +++ b/webapp/src/lib/components/MarkdownRenderer.svelte @@ -15,20 +15,30 @@ import ListItem from '$lib/marked/renderers/ListItem.svelte'; export let plaintext: string; + let ref: HTMLDivElement; // @ts-ignore: typing mismatch marked.use({ extensions: extensions }); const options = { ...marked.defaults, breaks: true }; + + function setTitle() { + const res = ref.querySelector('h1'); + if (res) { + document.title = res.innerText; + } + }