@streamdown/mermaid: plugin defaults override Mermaid's own theme and font
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 56/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- frontend
Direzione di ricerca
The issue points to createMermaidPlugin and its defaultConfig merge, but does not name a file or test. Start by locating that plugin and its configuration tests, then check how caller options reach Mermaid. Done when the plugin leaves Mermaid's theme and font defaults intact unless callers set them, with tests covering those defaults and explicit overrides.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
createMermaidPlugin puts the caller's config on top of its own defaults:
const defaultConfig: MermaidConfig = {
startOnLoad: false,
theme: "default",
securityLevel: "strict",
fontFamily: "monospace",
suppressErrorRendering: true,
};
// ...
let currentConfig = { ...defaultConfig, ...options.config };
Because of that, there's no way to get Mermaid's own theme and font back. On Mermaid 12, whose default theme is now redux-color, every diagram still draws with the old default theme in a monospace font.
Passing theme: undefined gets around the theme. Passing fontFamily: undefined doesn't help: Mermaid only writes its --mermaid-font-family rule when fontFamily is set, so the diagram ends up with no font rule at all.
We ended up writing our own small plugin so chat diagrams match the ones we draw elsewhere with Mermaid's defaults.
Could the plugin keep only the settings it needs (startOnLoad: false, and probably securityLevel and suppressErrorRendering) and leave theme and fontFamily to Mermaid unless the caller sets them? That changes how diagrams look for anyone relying on today's defaults, so it might need a major version or an opt-in option.
Seen on @streamdown/mermaid 1.0.3 (also current main) with mermaid 12.3.0. Happy to send a PR.
- Lingua principale
- TypeScript
- Stelle
- 5.7k
- Fork
- 319
- Merge medio
- 2g 14h
- PR unite (30g)
- 24
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di vercel/streamdown
-
remend: unclosed `$$` in a table cell is closed on a new line when an earlier line has mathForse già presa @orinnz l’ha presa 34 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
vercel/streamdown#652 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
vercel/streamdown#720 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
vercel/streamdown#719 ·
I maintainer di solito rispondono entro 1 giorno
-
allowedTags: a self-closing custom tag at the end of a line turns every later blank line into `<!---->` (preprocessCustomTags)Forse già presa @ahmedriad1 l’ha presa 8 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
vercel/streamdown#706 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
vercel/streamdown#699 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di vercel/streamdown
Issue simili
-
Navbar avatar and name stay stale after saving profile changesForse già presa @alexechoi l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
marmelab/atomic-crm#416 ·
I maintainer di solito rispondono entro 1 giorno
-
feature-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
bluesky-social/social-app#12343 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
lucide-icons/lucide#5165 ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature] Preferences - Keep the theme selection popover open after selection for quick previewAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
marktext/marktext#6033 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:desktop bug has repro platform:macos
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
anthropics/claude-code#107903 ·