mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 01:10:14 +01:00
🎨 style: Improve KaTeX Rendering for LaTeX Equations (#7223)
This commit is contained in:
parent
8e1012c5aa
commit
20c9f1a783
7 changed files with 7 additions and 6 deletions
|
|
@ -35,7 +35,7 @@ export const CodeMarkdown = memo(
|
||||||
const [userScrolled, setUserScrolled] = useState(false);
|
const [userScrolled, setUserScrolled] = useState(false);
|
||||||
const currentContent = content;
|
const currentContent = content;
|
||||||
const rehypePlugins = [
|
const rehypePlugins = [
|
||||||
[rehypeKatex, { output: 'mathml' }],
|
[rehypeKatex],
|
||||||
[
|
[
|
||||||
rehypeHighlight,
|
rehypeHighlight,
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,7 @@ const Markdown = memo(({ content = '', isLatestMessage }: TContentProps) => {
|
||||||
|
|
||||||
const rehypePlugins = useMemo(
|
const rehypePlugins = useMemo(
|
||||||
() => [
|
() => [
|
||||||
[rehypeKatex, { output: 'mathml' }],
|
[rehypeKatex],
|
||||||
[
|
[
|
||||||
rehypeHighlight,
|
rehypeHighlight,
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import { langSubset } from '~/utils';
|
||||||
const MarkdownLite = memo(
|
const MarkdownLite = memo(
|
||||||
({ content = '', codeExecution = true }: { content?: string; codeExecution?: boolean }) => {
|
({ content = '', codeExecution = true }: { content?: string; codeExecution?: boolean }) => {
|
||||||
const rehypePlugins: PluggableList = [
|
const rehypePlugins: PluggableList = [
|
||||||
[rehypeKatex, { output: 'mathml' }],
|
[rehypeKatex],
|
||||||
[
|
[
|
||||||
rehypeHighlight,
|
rehypeHighlight,
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ export default function VariableForm({
|
||||||
remarkPlugins={[supersub, remarkGfm, [remarkMath, { singleDollarTextMath: true }]]}
|
remarkPlugins={[supersub, remarkGfm, [remarkMath, { singleDollarTextMath: true }]]}
|
||||||
rehypePlugins={[
|
rehypePlugins={[
|
||||||
/** @ts-ignore */
|
/** @ts-ignore */
|
||||||
[rehypeKatex, { output: 'mathml' }],
|
[rehypeKatex],
|
||||||
/** @ts-ignore */
|
/** @ts-ignore */
|
||||||
[rehypeHighlight, { ignoreMissing: true }],
|
[rehypeHighlight, { ignoreMissing: true }],
|
||||||
]}
|
]}
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ const PromptDetails = ({ group }: { group?: TPromptGroup }) => {
|
||||||
]}
|
]}
|
||||||
rehypePlugins={[
|
rehypePlugins={[
|
||||||
/** @ts-ignore */
|
/** @ts-ignore */
|
||||||
[rehypeKatex, { output: 'mathml' }],
|
[rehypeKatex],
|
||||||
/** @ts-ignore */
|
/** @ts-ignore */
|
||||||
[rehypeHighlight, { ignoreMissing: true }],
|
[rehypeHighlight, { ignoreMissing: true }],
|
||||||
]}
|
]}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ const PromptEditor: React.FC<Props> = ({ name, isEditing, setIsEditing }) => {
|
||||||
}, [isEditing, prompt]);
|
}, [isEditing, prompt]);
|
||||||
|
|
||||||
const rehypePlugins: PluggableList = [
|
const rehypePlugins: PluggableList = [
|
||||||
[rehypeKatex, { output: 'mathml' }],
|
[rehypeKatex],
|
||||||
[
|
[
|
||||||
rehypeHighlight,
|
rehypeHighlight,
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import App from './App';
|
||||||
import './style.css';
|
import './style.css';
|
||||||
import './mobile.css';
|
import './mobile.css';
|
||||||
import { ApiErrorBoundaryProvider } from './hooks/ApiErrorBoundaryContext';
|
import { ApiErrorBoundaryProvider } from './hooks/ApiErrorBoundaryContext';
|
||||||
|
import 'katex/dist/katex.min.css';
|
||||||
|
|
||||||
const container = document.getElementById('root');
|
const container = document.getElementById('root');
|
||||||
const root = createRoot(container);
|
const root = createRoot(container);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue