π Open source, privacy-first web analytics β a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
emoji viz
Blue Mouse017bbcb51da8
diff --git a/web/app/utils/getPosts.ts b/web/app/utils/getPosts.tsindex 7aa53134c..91dc92537 100644--- a/web/app/utils/getPosts.ts+++ b/web/app/utils/getPosts.ts@@ -74,10 +74,12 @@ renderer.table = ({ header, rows }: Tokens.Table) => {</div>`}-// SVG icons for checkmark and cross-const CHECK_ICON_SVG = `<span class="inline-flex items-center justify-center size-6 rounded-full bg-emerald-100 dark:bg-emerald-900/30"><svg class="w-4 h-4 text-emerald-600 dark:text-emerald-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" role="img" aria-label="Yes"><path d="M20 6 9 17l-5-5"/></svg></span>`+// SVG icons for checkmark, cross, and warning+const CHECK_ICON_SVG = `<span class="inline-flex items-center justify-center size-6 rounded-full bg-emerald-100 dark:bg-emerald-900/30 align-middle"><svg class="w-4 h-4 text-emerald-600 dark:text-emerald-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" role="img" aria-label="Yes"><path d="M20 6 9 17l-5-5"/></svg></span>`-const CROSS_ICON_SVG = `<span class="inline-flex items-center justify-center size-6 rounded-full bg-red-100 dark:bg-red-900/30"><svg class="w-4 h-4 text-red-600 dark:text-red-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" role="img" aria-label="No"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></span>`+const CROSS_ICON_SVG = `<span class="inline-flex items-center justify-center size-6 rounded-full bg-red-100 dark:bg-red-900/30 align-middle"><svg class="w-4 h-4 text-red-600 dark:text-red-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" role="img" aria-label="No"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></span>`++const WARNING_ICON_SVG = `<span class="inline-flex items-center justify-center size-6 rounded-full bg-amber-100 dark:bg-amber-900/30 align-middle"><svg class="w-4 h-4 text-amber-600 dark:text-amber-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" role="img" aria-label="Warning"><path d="M12 9v4"/><path d="M12 17h.01"/><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/></svg></span>`// Inline Swetrix logo that inherits font sizeconst SWETRIX_LOGO_HTML = `<span class="inline-flex items-center gap-[0.15em] select-none whitespace-nowrap align-baseline"><img class="h-[0.9em] w-auto dark:hidden" src="/assets/logo/blue.png" alt="" /><img class="h-[0.9em] w-auto hidden dark:inline" src="/assets/logo/white.png" alt="" /><span class="font-bold text-indigo-950 dark:text-white">Swetrix</span></span>`@@ -165,7 +167,7 @@ renderer.blockquote = ({ text }: Tokens.Blockquote) => {// Function to replace emoji with styled iconsfunction replaceEmojiWithIcons(html: string): string {- return html.replace(/β /g, CHECK_ICON_SVG).replace(/β/g, CROSS_ICON_SVG)+ return html.replace(/β /g, CHECK_ICON_SVG).replace(/β/g, CROSS_ICON_SVG).replace(/β οΈ/g, WARNING_ICON_SVG)}// Function to replace ::SWETRIX_LOGO:: placeholder