From 379a9a89ed91dd8a190901c1d564228668416c0c Mon Sep 17 00:00:00 2001 From: Florian Orben Date: Mon, 30 Nov 2015 03:17:19 +0100 Subject: [PATCH] support gfm tasklists --- web/react/utils/markdown.jsx | 8 ++++++++ web/sass-files/sass/partials/_post.scss | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx index 9d9bdfb7a6..609e93e1d8 100644 --- a/web/react/utils/markdown.jsx +++ b/web/react/utils/markdown.jsx @@ -223,6 +223,14 @@ class MattermostMarkdownRenderer extends marked.Renderer { return `${header}${body}
`; } + listitem(text) { + const taskListReg = /^\[([ |xX])\] /; + const isTaskList = taskListReg.exec(text); + return isTaskList ? + `
  • ${' '}${text.replace(taskListReg, '')}
  • ` : + `
  • ${text}
  • `; + } + 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 b7a305427c..ed16326811 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; + } } }