Skip to content

feat(markdown-renderer): add optional LaTeX rendering support#1816

Draft
Killusions wants to merge 3 commits intomainfrom
feat/markdown-renderer-latex
Draft

feat(markdown-renderer): add optional LaTeX rendering support#1816
Killusions wants to merge 3 commits intomainfrom
feat/markdown-renderer-latex

Conversation

@Killusions
Copy link
Copy Markdown
Member

@Killusions Killusions commented Apr 2, 2026

Merge after #1810 and #1811

Add optional latex rendering to the markdown renderer
for rendering math expressions (common in AI chatbots),
used to integrate libraries like katex

Supports both inline ($...$) and display ($$...$$) math


Documentation.
Examples.
Dashboards Demo.
Playwright report.

Coverage Reports:

Code Coverage

Add max-inline-size constraint to message bubble and wrapper to prevent
overflow. Fix attachment preview backdrop click behavior. Use index-based
tracking for message list and add scroll-to-bottom on message send.
Update example action labels for clarity.
…line and caching

Rewrite the markdown renderer to use a recursive processing pipeline with
placeholder-based architecture. Add SSR support via optional doc/isBrowser
parameters. Introduce LRU caching for code blocks and tables. Improve
table rendering with proper thead/th support. Add code-wrapper structure
with language labels. Update SCSS for new structural layout including
code-wrapper, table-wrapper, and table-scroll-container.
Add optional latex rendering to the markdown renderer
for rendering math expressions (common in AI chatbots),
used to integrate libraries like katex

Supports both inline ($...$) and display ($$...$$) math
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces LaTeX mathematical expression support to the markdown renderer using KaTeX. Key changes include a significant refactor of the getMarkdownRenderer utility to support SSR via DOCUMENT and PLATFORM_ID injection, the implementation of an LRU caching strategy for rendered elements (code blocks, tables, and LaTeX), and the addition of a latexRenderer input to the SiMarkdownRendererComponent. Furthermore, the PR includes updated SCSS styles for improved code block and table presentation, new helper functions for style-preserving HTML sanitization, and comprehensive unit test updates. I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant