Subhadip007 commited on
Commit
b85e4b6
·
1 Parent(s): 43419f9

fix(ui): fix citation links rendering in markdown and bypass katex parsing errs

Browse files
frontend-next/app/globals.css CHANGED
@@ -1034,3 +1034,18 @@ select {
1034
  .markdown-body li { margin-bottom: 0.25em; }
1035
  .markdown-body strong { color: #fff; font-weight: 600; }
1036
  .markdown-body .inline-code { background: rgba(0,0,0,0.5); padding: 2px 6px; border-radius: 4px; font-family: "JetBrains Mono", monospace; font-size: 0.9em; color: var(--accent); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1034
  .markdown-body li { margin-bottom: 0.25em; }
1035
  .markdown-body strong { color: #fff; font-weight: 600; }
1036
  .markdown-body .inline-code { background: rgba(0,0,0,0.5); padding: 2px 6px; border-radius: 4px; font-family: "JetBrains Mono", monospace; font-size: 0.9em; color: var(--accent); }
1037
+
1038
+
1039
+ /* KaTeX Overrides for strict centering and sizing */
1040
+ .markdown-body .katex-display {
1041
+ display: block !important;
1042
+ text-align: center !important;
1043
+ margin: 1.5rem 0 !important;
1044
+ overflow-x: auto;
1045
+ overflow-y: hidden;
1046
+ padding: 10px 0;
1047
+ }
1048
+ .markdown-body .katex {
1049
+ font-size: 1.1em;
1050
+ }
1051
+
frontend-next/app/page.tsx CHANGED
@@ -139,7 +139,8 @@ const MessageRenderer = ({ content, isStreaming }: { content: string, isStreamin
139
  <div className="markdown-body">
140
  <ReactMarkdown
141
  remarkPlugins={[remarkGfm, remarkMath]}
142
- rehypePlugins={[rehypeKatex]}
 
143
  components={{
144
  code({node, inline, className, children, ...props}: any) {
145
  const match = /language-(\w+)/.exec(className || '');
 
139
  <div className="markdown-body">
140
  <ReactMarkdown
141
  remarkPlugins={[remarkGfm, remarkMath]}
142
+ rehypePlugins={[[rehypeKatex, { strict: false, throwOnError: false }]]}
143
+ urlTransform={(url) => url}
144
  components={{
145
  code({node, inline, className, children, ...props}: any) {
146
  const match = /language-(\w+)/.exec(className || '');