fix inconsistency with GitHub Markdown API output for tasklist

fixes #10
This commit is contained in:
Sindre Sorhus 2014-10-01 18:05:52 +02:00
parent b276012212
commit 67987bd089
2 changed files with 6 additions and 1 deletions

View File

@ -689,7 +689,7 @@
margin-top: 3px; margin-top: 3px;
} }
.markdown-body .task-list-item-checkbox { .markdown-body .task-list-item input {
float: left; float: left;
margin: 0.3em 0 0.25em -1.6em; margin: 0.3em 0 0.25em -1.6em;
vertical-align: middle; vertical-align: middle;

View File

@ -57,6 +57,11 @@ function cleanupCss(str) {
return false; return false;
} }
// work around GitHub Markdown API inconsistency #10
if (el.selectors[0] === '.task-list-item-checkbox') {
el.selectors[0] = '.task-list-item input';
}
// remove `body` from `body, input {}` // remove `body` from `body, input {}`
if (el.selectors[0] === 'body' && el.selectors[1] === 'input') { if (el.selectors[0] === 'body' && el.selectors[1] === 'input') {
el.selectors.shift(); el.selectors.shift();