diff --git a/package.json b/package.json index 08ca373..d2c9346 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,10 @@ "inferno-router": "^3.9.0", "inferno-scripts": "4.2.0", "linkstate": "^1.1.0", - "milligram": "^1.3.0" + "milligram": "^1.3.0", + "react": "^16.0.0", + "remarkable": "^1.7.1", + "remarkable-react": "^1.0.1" }, "proxy": "http://localhost:3000", "scripts": { diff --git a/src/QuestionViewer/index.js b/src/QuestionViewer/index.js index a72172e..c856858 100644 --- a/src/QuestionViewer/index.js +++ b/src/QuestionViewer/index.js @@ -1,6 +1,17 @@ import { Link } from 'inferno-router'; import linkState from 'linkstate'; import Component from 'inferno-component'; +var Remarkable = require('remarkable'); +var md = new Remarkable({ + html: true, + xhtmlOut: false, + breaks: false, + langPrefix: 'language-', + linkify: false, + typographer: false, + quotes: '“”‘’', + highlight: function (/*str, lang*/) { return ''; } +}); class QuestionViewer extends Component { state = { @@ -25,6 +36,7 @@ class QuestionViewer extends Component { // Read fetch documentation on how to send post request and // display output in window.alert } + render() { const { loading, question, error, answer } = this.state const qno = parseInt(this.props.params.qno,10) @@ -34,7 +46,7 @@ class QuestionViewer extends Component {
- {question.body} +