diff --git a/.eslintrc.js b/.eslintrc.js index 51d0db63..ba61b135 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,9 +7,9 @@ const config = createConfig('eslint', { 'import/no-named-as-default-member': 'off', 'import/no-import-module-exports': 'off', 'import/no-self-import': 'off', - 'spaced-comment': ['error', 'always', { 'block': { 'exceptions': ['*'] } }], + 'spaced-comment': ['error', 'always', { block: { exceptions: ['*'] } }], 'react-hooks/rules-of-hooks': 'off', - "react/forbid-prop-types": ["error", { "forbid": ["any", "array"] }], // arguable object proptype is use when I do not care about the shape of the object + 'react/forbid-prop-types': ['error', { forbid: ['any', 'array'] }], // arguable object proptype is use when I do not care about the shape of the object 'no-import-assign': 'off', 'no-promise-executor-return': 'off', 'import/no-cycle': 'off', @@ -17,10 +17,10 @@ const config = createConfig('eslint', { }); config.settings = { - "import/resolver": { + 'import/resolver': { node: { - paths: ["src", "node_modules"], - extensions: [".js", ".jsx"], + paths: ['src', 'node_modules'], + extensions: ['.js', '.jsx'], }, }, }; diff --git a/package.json b/package.json index 136b0984..ae7b80ff 100755 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "@testing-library/user-event": "^14.0.0", "@zip.js/zip.js": "^2.4.6", "axios": "^0.28.0", + "better-react-mathjax": "^2.0.3", "classnames": "^2.3.1", "core-js": "3.35.1", "dompurify": "^2.3.1", diff --git a/src/App.jsx b/src/App.jsx index e8d513c6..068aa920 100755 --- a/src/App.jsx +++ b/src/App.jsx @@ -11,6 +11,7 @@ import { selectors } from 'data/redux'; import DemoWarning from 'containers/DemoWarning'; import NotificationsBanner from 'containers/NotificationsBanner'; import ListView from 'containers/ListView'; +import { MathJaxContext } from 'better-react-mathjax'; import './App.scss'; import Head from './components/Head'; @@ -28,7 +29,9 @@ export const App = ({ courseMetadata, isEnabled }) => ( {!isEnabled && }
- + + +
diff --git a/src/containers/ResponseDisplay/__snapshots__/index.test.jsx.snap b/src/containers/ResponseDisplay/__snapshots__/index.test.jsx.snap index e2fabe06..8beb3794 100644 --- a/src/containers/ResponseDisplay/__snapshots__/index.test.jsx.snap +++ b/src/containers/ResponseDisplay/__snapshots__/index.test.jsx.snap @@ -4,16 +4,18 @@ exports[`ResponseDisplay component snapshot file upload disable with valid respo
- - + - parsed html (sanitized (some text response here)) - - + + parsed html (sanitized (some text response here)) + + +
`; @@ -70,16 +72,18 @@ exports[`ResponseDisplay component snapshot file upload enable with valid respon ] } /> - - + - parsed html (sanitized (some text response here)) - - + + parsed html (sanitized (some text response here)) + + + `; diff --git a/src/containers/ResponseDisplay/index.jsx b/src/containers/ResponseDisplay/index.jsx index e2cd4b5c..6c0822cb 100644 --- a/src/containers/ResponseDisplay/index.jsx +++ b/src/containers/ResponseDisplay/index.jsx @@ -1,6 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; +import { MathJax } from 'better-react-mathjax'; import { Card } from '@openedx/paragon'; @@ -47,9 +48,13 @@ export class ResponseDisplay extends React.Component { { /* eslint-disable react/no-array-index-key */ this.textContents.map((textContent, index) => ( - - {textContent} - + + + + {textContent} + + + )) }