Repository navigation
Let deployments register renderers for custom code-fence languages #17940
tfredricks
started this conversation in
Feature Requests & Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
LibreChat already draws a
```mermaidfence as a diagram instead of code. I'd like a supported way to add other fence languages, so a deployment can render something like```quizas an interactive component without patching upstream files.Why: we wanted multiple-choice quizzes to show as an interactive card in the reply. The only no-code option, an MCP tool returning MCP-UI HTML, shows up as a server in the MCP panel, adds its tool definition to every message, and can't follow the app theme. Rendering a fence client-side, the way
mermaidworks, avoids all of that, but today it means patchingMarkdownComponents.tsxormarkdownConfig.tsand re-applying the patch on every release.Proposal: a small client-side registry that the
coderenderer checks before falling back toCodeBlock:MermaidErrorBoundarydoes.mathandmermaidtoday, so artifact and code-block ids stay stable.mermaidcould move into the registry as its first entry.This touches only
MarkdownComponents.tsx,markdownConfig.tsand a new registry module with tests. No server or config changes.I'm happy to open a PR if the direction works for you.
All reactions