diff --git a/src/core/render/compiler.js b/src/core/render/compiler.js index b086b1476..91b954c02 100644 --- a/src/core/render/compiler.js +++ b/src/core/render/compiler.js @@ -302,6 +302,23 @@ export class Compiler { return `${text}` } + origin.list = renderer.list = function (body, ordered, start) { + const isTaskList = /
  • /.test(body.split('class="task-list"')[0]) + const isStartReq = start && start > 1 + const tag = ordered ? 'ol' : 'ul' + const tagAttrs = [ + (isTaskList ? 'class="task-list"' : ''), + (isStartReq ? `start="${start}"` : '') + ].join(' ').trim() + + return `<${tag} ${tagAttrs}>${body}` + } + origin.listitem = renderer.listitem = function (text) { + const isTaskItem = /^(]*>)/.test(text) + const html = isTaskItem ? `
  • ` : `
  • ${text}
  • ` + + return html + } renderer.origin = origin diff --git a/src/themes/basic/_layout.styl b/src/themes/basic/_layout.styl index f74d1ede8..4e00e33f0 100644 --- a/src/themes/basic/_layout.styl +++ b/src/themes/basic/_layout.styl @@ -383,6 +383,9 @@ body.sticky border-radius 2px padding 1rem +.markdown-section ul.task-list > li + list-style-type none + body.close .sidebar transform translateX(- $sidebar-width)