Skip to content

Commit

Permalink
Render HTML in Problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Matushl committed Nov 11, 2023
1 parent 226e0d0 commit 226b1b2
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 226b1b2

Please sign in to comment.