Merge pull request #1543 from florianorben/GFM-Tasklist
Support Tasklists like GitHub does
Этот коммит содержится в:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user