Skip to content

Commit

Permalink
Merge pull request #1440 from x13machine/master
Browse files Browse the repository at this point in the history
Pass token boolean to the listitem function.
  • Loading branch information
styfle authored Mar 9, 2019
2 parents 5ed5271 + 7de5376 commit 9fcb791
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The following table lists the ticket type labels we use when there is work to be
|:----------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|L0 - security |A security vulnerability within the Marked library is discovered. |
|L1 - broken |Valid usage results in incorrect output compared to [supported specifications](#/README.md#specifications) OR causes marked to crash AND there is no known workaround for the issue. |
|L2 - annoying |Similar to L1 - broken only there is a known workaround avaialable for the issue. |
|L2 - annoying |Similar to L1 - broken only there is a known workaround available for the issue. |
|RR - refactor and re-engineer |Results in an improvement to developers using Marked (improved readability) or end-users (faster performance) or both. |
|NFS - new feature (spec related) |A capability Marked does not currently provide but is in one of the [supported specifications](#/README.md#specifications) |
|NFU - new feature (user requested) |A capability Marked does not currently provide but has been requested by users of Marked. |
Expand Down
2 changes: 1 addition & 1 deletion docs/USING_PRO.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ console.log(myMarked('# heading+', { renderer: renderer }));
- heading(*string* text, *number* level, *string* raw, *Slugger* slugger)
- hr()
- list(*string* body, *boolean* ordered, *number* start)
- listitem(*string* text)
- listitem(*string* text, *boolean* task, *boolean* checked)
- checkbox(*boolean* checked)
- paragraph(*string* text)
- table(*string* header, *string* body)
Expand Down
7 changes: 4 additions & 3 deletions lib/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -1258,18 +1258,19 @@ Parser.prototype.tok = function() {
case 'list_item_start': {
body = '';
var loose = this.token.loose;
var checked = this.token.checked;
var task = this.token.task;

if (this.token.task) {
body += this.renderer.checkbox(this.token.checked);
body += this.renderer.checkbox(checked);
}

while (this.next().type !== 'list_item_end') {
body += !loose && this.token.type === 'text'
? this.parseText()
: this.tok();
}

return this.renderer.listitem(body);
return this.renderer.listitem(body, task, checked);
}
case 'html': {
// TODO parse inline content if parameter markdown=1
Expand Down

0 comments on commit 9fcb791

Please sign in to comment.