diff --git a/frontend/src/lib/components/legend/legend-content.vue b/frontend/src/lib/components/legend/legend-content.vue index 4bc6fb92..0047f320 100644 --- a/frontend/src/lib/components/legend/legend-content.vue +++ b/frontend/src/lib/components/legend/legend-content.vue @@ -24,11 +24,11 @@ const itemIconRefs = reactive(new Map()); const legend1Html = computed(() => { - return props.legend1 ? markdownBlock(props.legend1) : ""; + return props.legend1 ? markdownBlock(props.legend1, true) : ""; }); const legend2Html = computed(() => { - return props.legend2 ? markdownBlock(props.legend2) : ""; + return props.legend2 ? markdownBlock(props.legend2, true) : ""; }); function toggleFilter(typeInfo: LegendType, item?: LegendItem): void { diff --git a/leaflet/download-icons.ts b/leaflet/download-icons.ts index 4c52bc6c..4934460b 100644 --- a/leaflet/download-icons.ts +++ b/leaflet/download-icons.ts @@ -1,7 +1,7 @@ import fetch from "node-fetch"; import * as yauzl from "yauzl-promise"; import * as svgo from "svgo"; -import cheerio from "cheerio"; +import { load, type Element } from "cheerio"; import { writeFile } from "fs/promises"; import { fileURLToPath } from "url"; import { Readable } from "stream"; @@ -30,11 +30,11 @@ async function updateIcons() { function cleanIcon(icon: string): string { const optimized = svgo.optimize(icon); - const $ = cheerio.load(optimized.data, { + const $ = load(optimized.data, { xmlMode: true }); - for (const el of $("*").toArray() as cheerio.TagElement[]) { + for (const el of $("*").toArray() as Element[]) { el.name = el.name.replace(/^svg:/, ""); } diff --git a/utils/vite.config.ts b/utils/vite.config.ts index 90d526b8..1e73c03d 100644 --- a/utils/vite.config.ts +++ b/utils/vite.config.ts @@ -16,7 +16,7 @@ export default defineConfig({ formats: ['es'] }, rollupOptions: { - external: (id) => !id.startsWith("./") && !id.startsWith("../") && /* resolved internal modules */ !id.startsWith("/") + external: (id) => id.includes("/node_modules/") || (!id.startsWith("./") && !id.startsWith("../") && /* resolved internal modules */ !id.startsWith("/")) } } });