Skip to content

Commit

Permalink
Render HTML in Problem (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matushl authored Nov 11, 2023
1 parent 1e4e090 commit b9be10e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Latex/Latex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const Latex: FC<{children: string}> = ({children}) => {

for (const m of matches) {
result.push(
<span>{children.slice(currentPosition, m.index)}</span>,
<span dangerouslySetInnerHTML={{__html: `${children.slice(currentPosition, m.index)}`}} />,
<MathComponent tex={trim(m[0])} display={m[0].slice(0, 2) === '\\[' || m[0].slice(0, 2) === '$$'} />,
)

Expand All @@ -42,7 +42,7 @@ export const Latex: FC<{children: string}> = ({children}) => {
}
}

result.push(<span>{children.slice(Math.max(0, currentPosition))}</span>)
result.push(<span dangerouslySetInnerHTML={{__html: `${children.slice(Math.max(0, currentPosition))}`}} />)

return (
// nas globalny CSS reset nastavuje SVGcka na display:block, tak to tu resetneme nazad na inline
Expand Down

0 comments on commit b9be10e

Please sign in to comment.