fraudTech commited on
Commit
0e31a80
·
1 Parent(s): 48f84ff

fix latex render for examples display

Browse files
Files changed (1) hide show
  1. web/src/App.tsx +11 -3
web/src/App.tsx CHANGED
@@ -889,11 +889,11 @@ function App() {
889
  ];
890
  const generalistExamples = [
891
  {
892
- label: 'Prove sqrt(2) is irrational (Lean 4)',
893
  prompt: 'Prove that sqrt(2) is irrational using first principles in Lean 4.',
894
  },
895
  {
896
- label: 'Solve integral x^2 sin(x)',
897
  prompt: 'Solve the integral of x^2 sin(x) with SymPy and show the result.',
898
  },
899
  {
@@ -1785,7 +1785,15 @@ function App() {
1785
  <div className="examples">
1786
  {(assistantMode === 'legal-support' ? legalExamples : generalistExamples).map((example) => (
1787
  <button key={example.label} className="example-btn" onClick={() => setInput(example.prompt)}>
1788
- <span>{example.label}</span>
 
 
 
 
 
 
 
 
1789
  </button>
1790
  ))}
1791
  </div>
 
889
  ];
890
  const generalistExamples = [
891
  {
892
+ label: 'Prove $\\sqrt{2}$ is irrational (Lean 4)',
893
  prompt: 'Prove that sqrt(2) is irrational using first principles in Lean 4.',
894
  },
895
  {
896
+ label: 'Solve integral $x^2\\sin(x)$',
897
  prompt: 'Solve the integral of x^2 sin(x) with SymPy and show the result.',
898
  },
899
  {
 
1785
  <div className="examples">
1786
  {(assistantMode === 'legal-support' ? legalExamples : generalistExamples).map((example) => (
1787
  <button key={example.label} className="example-btn" onClick={() => setInput(example.prompt)}>
1788
+ <ReactMarkdown
1789
+ remarkPlugins={[remarkMath]}
1790
+ rehypePlugins={[rehypeKatex]}
1791
+ components={{
1792
+ p: ({ children }) => <span>{children}</span>,
1793
+ }}
1794
+ >
1795
+ {example.label}
1796
+ </ReactMarkdown>
1797
  </button>
1798
  ))}
1799
  </div>