diff --git a/apps/comments-ui/src/components/Comment.js b/apps/comments-ui/src/components/Comment.js
index f3c8de29b3..5f8970057d 100644
--- a/apps/comments-ui/src/components/Comment.js
+++ b/apps/comments-ui/src/components/Comment.js
@@ -4,6 +4,8 @@ import {formatRelativeTime} from '../utils/helpers';
function Comment(props) {
const comment = props.comment;
+ const html = {__html: comment.html};
+
return (
@@ -18,7 +20,7 @@ function Comment(props) {
diff --git a/apps/comments-ui/src/components/Form.js b/apps/comments-ui/src/components/Form.js
index 62f3330f3b..3bc5c4a5e3 100644
--- a/apps/comments-ui/src/components/Form.js
+++ b/apps/comments-ui/src/components/Form.js
@@ -14,6 +14,13 @@ class Form extends React.Component {
this.handleChange = this.handleChange.bind(this);
}
+ getHTML() {
+ const text = this.state.message;
+
+ // Convert newlines to
for now (until we add a real editor)
+ return text.replace('\n', '
');
+ }
+
async submitForm(event) {
event.preventDefault();
const message = this.state.message;
@@ -28,7 +35,7 @@ class Form extends React.Component {
await this.context.onAction('addComment', {
post_id: this.context.postId,
status: 'published',
- html: message
+ html: this.getHTML()
});
// Clear message on success