11 lines
251 B
JavaScript
11 lines
251 B
JavaScript
|
|
import katex from 'katex';
|
||
|
|
|
||
|
|
export default function Katex({ math, block = false }) {
|
||
|
|
const html = katex.renderToString(math, {
|
||
|
|
throwOnError: false,
|
||
|
|
displayMode: block,
|
||
|
|
});
|
||
|
|
|
||
|
|
return <span dangerouslySetInnerHTML={{ __html: html }} />;
|
||
|
|
}
|