mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 04:39:58 +00:00
web: remove built-in sveltekit announcer (for real this time)
This commit is contained in:
parent
3fdfd44515
commit
b4f17487b4
2 changed files with 11 additions and 6 deletions
|
@ -3,8 +3,6 @@
|
|||
import "@fontsource/ibm-plex-mono/400-italic.css";
|
||||
import "@fontsource/ibm-plex-mono/500.css";
|
||||
|
||||
import { beforeUpdate } from "svelte";
|
||||
|
||||
import { page } from "$app/stores";
|
||||
import { updated } from "$app/stores";
|
||||
import { browser } from "$app/environment";
|
||||
|
@ -35,10 +33,6 @@
|
|||
document.querySelector("[data-first-focus]");
|
||||
to_focus?.focus();
|
||||
});
|
||||
|
||||
beforeUpdate(() => {
|
||||
document.getElementById("svelte-announcer")?.remove();
|
||||
})
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
|
|
|
@ -10,6 +10,17 @@ const config = {
|
|||
// for more information about preprocessors
|
||||
extensions: [".svelte", ".md"],
|
||||
preprocess: [
|
||||
{
|
||||
name: "strip-announcer",
|
||||
markup: ({ content: code }) => {
|
||||
code = code.replace(
|
||||
/<div id="svelte-announcer" [\s\S]*?<\/div>/,
|
||||
'<svelte:component this={null} />'
|
||||
);
|
||||
|
||||
return { code }
|
||||
}
|
||||
},
|
||||
sveltePreprocess(),
|
||||
mdsvex({
|
||||
extensions: ['.md'],
|
||||
|
|
Loading…
Reference in a new issue