diff --git a/lib/handlers/list-item.js b/lib/handlers/list-item.js index e8df28e..fd3f0a6 100644 --- a/lib/handlers/list-item.js +++ b/lib/handlers/list-item.js @@ -32,6 +32,7 @@ function listItem(h, node, parent) { var single = (!parent || !parent.loose) && head.children && children.length === 1; var result = all(h, single ? head : node); var container; + var props = {}; if (typeof node.checked === 'boolean') { if (!single && head.type !== 'paragraph') { @@ -49,11 +50,14 @@ function listItem(h, node, parent) { checked: node.checked, disabled: true })); + + /* according to github-markdown-css, this class hides bullet. */ + props.className = ['task-list-item']; } if (!single && result.length) { result = wrap(result, true); } - return h(node, 'li', result); + return h(node, 'li', props, result); } diff --git a/test/list-item.js b/test/list-item.js index 1dea1bb..4fc200a 100644 --- a/test/list-item.js +++ b/test/list-item.js @@ -50,7 +50,7 @@ test('ListItem', function (t) { to(u('listItem', {checked: true}, [ u('paragraph', [u('text', 'québec')]) ])), - u('element', {tagName: 'li', properties: {}}, [ + u('element', {tagName: 'li', properties: {className: ['task-list-item']}}, [ u('element', { tagName: 'input', properties: { @@ -70,7 +70,7 @@ test('ListItem', function (t) { u('paragraph', [u('text', 'romeo')]), u('paragraph', [u('text', 'sierra')]) ])), - u('element', {tagName: 'li', properties: {}}, [ + u('element', {tagName: 'li', properties: {className: ['task-list-item']}}, [ u('text', '\n'), u('element', {tagName: 'p', properties: {}}, [ u('element', { @@ -97,7 +97,7 @@ test('ListItem', function (t) { to(u('listItem', {checked: true}, [ u('html', '') ])), - u('element', {tagName: 'li', properties: {}}, [ + u('element', {tagName: 'li', properties: {className: ['task-list-item']}}, [ u('text', '\n'), u('element', {tagName: 'p', properties: {}}, [ u('element', {