@streamdown/mermaid: plugin defaults override Mermaid's own theme and font
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 56/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- frontend
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 5.7k
- フォーク
- 319
- 平均マージ
- 2日 14時間
- マージ済み PR(30日)
- 24
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
vercel/streamdown のほかの issue
-
remend: unclosed `$$` in a table cell is closed on a new line when an earlier line has math対応中かも @orinnz が 34 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
vercel/streamdown#652 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
vercel/streamdown#720 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
vercel/streamdown#719 ·
メンテナーはふだん 1 日以内に返信
-
allowedTags: a self-closing custom tag at the end of a line turns every later blank line into `<!---->` (preprocessCustomTags)対応中かも @ahmedriad1 が 8 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
vercel/streamdown#706 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
vercel/streamdown#699 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
vercel/streamdown の issue をすべて見る
似ている issue
-
Navbar avatar and name stay stale after saving profile changes対応中かも @alexechoi が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
marmelab/atomic-crm#416 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
epam/ai-dial-react-file-manager#99 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
canonical/craft-actions#146 ·
メンテナーはふだん 2 日以内に返信
-
feature-request
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
bluesky-social/social-app#12343 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
lucide-icons/lucide#5165 ·
メンテナーはふだん 1 日以内に返信