summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorFlorian Orben <florian.orben@gmail.com>2015-11-30 03:17:19 +0100
committerFlorian Orben <florian.orben@gmail.com>2015-11-30 18:26:32 +0100
commit379a9a89ed91dd8a190901c1d564228668416c0c (patch)
tree4a0f0280f189ba525b6bdc9ed8318b2adc467ba6 /web
parentc919bd9e52e56621c9f94007de6410c3810e06c3 (diff)
downloadchat-379a9a89ed91dd8a190901c1d564228668416c0c.tar.gz
chat-379a9a89ed91dd8a190901c1d564228668416c0c.tar.bz2
chat-379a9a89ed91dd8a190901c1d564228668416c0c.zip
support gfm tasklists
Diffstat (limited to 'web')
-rw-r--r--web/react/utils/markdown.jsx8
-rw-r--r--web/sass-files/sass/partials/_post.scss5
2 files changed, 13 insertions, 0 deletions
diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx
index 9d9bdfb7a..609e93e1d 100644
--- a/web/react/utils/markdown.jsx
+++ b/web/react/utils/markdown.jsx
@@ -223,6 +223,14 @@ class MattermostMarkdownRenderer extends marked.Renderer {
return `<table class="markdown__table"><thead>${header}</thead><tbody>${body}</tbody></table>`;
}
+ listitem(text) {
+ const taskListReg = /^\[([ |xX])\] /;
+ const isTaskList = taskListReg.exec(text);
+ return isTaskList ?
+ `<li>${'<input type="checkbox" disabled="disabled" ' + (isTaskList[1] === ' ' ? '' : 'checked="checked" ') + '/> '}${text.replace(taskListReg, '')}</li>` :
+ `<li>${text}</li>`;
+ }
+
text(txt) {
return TextFormatting.doFormatText(txt, this.formattingOptions);
}
diff --git a/web/sass-files/sass/partials/_post.scss b/web/sass-files/sass/partials/_post.scss
index b7a305427..ed1632681 100644
--- a/web/sass-files/sass/partials/_post.scss
+++ b/web/sass-files/sass/partials/_post.scss
@@ -607,6 +607,11 @@ body.ios {
li ul, li ol {
padding: 0 0 0 20px
}
+
+ li input[type="checkbox"]:disabled {
+ vertical-align: sub;
+ cursor: default;
+ }
}
}