summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-11-30 20:35:13 -0800
committerCorey Hulen <corey@hulen.com>2015-11-30 20:35:13 -0800
commit441c9991ff1a4acc613c19ea8d96f17c60bce0c4 (patch)
tree82436bbfc9468a9d6fb48d2414213fe91825fe7b /web
parentf8fa1af4b8843cd9d5c3bbff0af27f0e8f9642df (diff)
parent6cd283e7f6c6e0d3878df54ba957e513b5190081 (diff)
downloadchat-441c9991ff1a4acc613c19ea8d96f17c60bce0c4.tar.gz
chat-441c9991ff1a4acc613c19ea8d96f17c60bce0c4.tar.bz2
chat-441c9991ff1a4acc613c19ea8d96f17c60bce0c4.zip
Merge pull request #1543 from florianorben/GFM-Tasklist
Support Tasklists like GitHub does
Diffstat (limited to 'web')
-rw-r--r--web/react/utils/markdown.jsx10
-rw-r--r--web/sass-files/sass/partials/_post.scss5
2 files changed, 15 insertions, 0 deletions
diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx
index 9d9bdfb7a..f2721c81d 100644
--- a/web/react/utils/markdown.jsx
+++ b/web/react/utils/markdown.jsx
@@ -223,6 +223,16 @@ 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);
+
+ if (isTaskList) {
+ return `<li>${'<input type="checkbox" disabled="disabled" ' + (isTaskList[1] === ' ' ? '' : 'checked="checked" ') + '/> '}${text.replace(taskListReg, '')}</li>`;
+ }
+ return `<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;
+ }
}
}