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);
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user