diff --git a/webapp/components/Comment.vue b/webapp/components/Comment.vue
index fbb39c094..4d71025f9 100644
--- a/webapp/components/Comment.vue
+++ b/webapp/components/Comment.vue
@@ -29,9 +29,10 @@
-
@@ -62,7 +63,7 @@ import { mapGetters } from 'vuex'
import HcUser from '~/components/User/User'
import ContentMenu from '~/components/ContentMenu'
import ContentViewer from '~/components/Editor/ContentViewer'
-import HcEditCommentForm from '~/components/EditCommentForm/EditCommentForm'
+import HcCommentForm from '~/components/CommentForm/CommentForm'
import CommentMutations from '~/graphql/CommentMutations'
export default {
@@ -76,7 +77,7 @@ export default {
HcUser,
ContentMenu,
ContentViewer,
- HcEditCommentForm,
+ HcCommentForm,
},
props: {
post: { type: Object, default: () => {} },
diff --git a/webapp/components/CommentForm/CommentForm.spec.js b/webapp/components/CommentForm/CommentForm.spec.js
index 594c6e45b..964730b5f 100644
--- a/webapp/components/CommentForm/CommentForm.spec.js
+++ b/webapp/components/CommentForm/CommentForm.spec.js
@@ -41,6 +41,9 @@ describe('CommentForm.vue', () => {
error: jest.fn(),
success: jest.fn(),
},
+ $filters: {
+ removeHtml: a => a,
+ },
}
propsData = {
post: {
diff --git a/webapp/components/CommentForm/CommentForm.vue b/webapp/components/CommentForm/CommentForm.vue
index 765bb22af..5712536a6 100644
--- a/webapp/components/CommentForm/CommentForm.vue
+++ b/webapp/components/CommentForm/CommentForm.vue
@@ -2,18 +2,18 @@
-
+
+
-
+
{{ $t('actions.cancel') }}
@@ -30,6 +30,7 @@
diff --git a/webapp/constants/comment.js b/webapp/constants/comment.js
new file mode 100644
index 000000000..bab79ad37
--- /dev/null
+++ b/webapp/constants/comment.js
@@ -0,0 +1 @@
+export const COMMENT_MIN_LENGTH = 1
diff --git a/webapp/plugins/vue-filters.js b/webapp/plugins/vue-filters.js
index 2001ee67b..f0b40de93 100644
--- a/webapp/plugins/vue-filters.js
+++ b/webapp/plugins/vue-filters.js
@@ -83,10 +83,13 @@ export default ({ app = {} }) => {
return excerpt
},
- removeHtml: content => {
+ removeHtml: (content, replaceLinebreaks = true) => {
if (!content) return ''
- // replace linebreaks with spaces first
- let contentExcerpt = content.replace(/
/gim, ' ').trim()
+ let contentExcerpt = content
+ if (replaceLinebreaks) {
+ // replace linebreaks with spaces first
+ contentExcerpt = contentExcerpt.replace(/
/gim, ' ').trim()
+ }
// remove the rest of the HTML
contentExcerpt = contentExcerpt.replace(/<(?:.|\n)*?>/gm, '').trim()