fix(client): replace decodeHTMLEntities to entities package

This commit is contained in:
Valeriy
2019-01-27 17:15:21 +03:00
committed by Stuart Taylor
parent fbb15afa88
commit dd41028f5b
6 changed files with 10 additions and 35 deletions

View File

@@ -39,8 +39,6 @@ import {
import './classic.css';
import '../components/test-frame.css';
import decodeHTMLEntities from '../../../../utils/decodeHTMLEntities';
const mapStateToProps = createStructuredSelector({
files: challengeFilesSelector,
tests: challengeTestsSelector,
@@ -237,7 +235,7 @@ class ShowClassic extends Component {
* Your test output will go here.
*/
`}
output={decodeHTMLEntities(output)}
output={output}
/>
);
}

View File

@@ -1,6 +1,7 @@
import React, { Fragment, Component } from 'react';
import PropTypes from 'prop-types';
import MonacoEditor from 'react-monaco-editor';
import { decodeHTML } from 'entities';
const propTypes = {
defaultOutput: PropTypes.string,
@@ -51,7 +52,7 @@ class Output extends Component {
editorDidMount={::this.editorDidMount}
height={height}
options={options}
value={output ? output : defaultOutput}
value={decodeHTML(output ? output : defaultOutput)}
/>
</Fragment>
);

View File

@@ -148,7 +148,9 @@ function* executeTests(testRunner) {
throw err;
}
} catch (err) {
newTest.message = text.replace(/<code>(.*?)<\/code>/g, '$1');
newTest.message = text
.replace(/<code>(.*?)<\/code>/g, '$1')
.replace(/<wbr>/g, '');
if (err === 'timeout') {
newTest.err = 'Test timed out';
newTest.message = `${newTest.message} (${newTest.err})`;