Skip to content

Commit 9fcb791

Browse files
authored
Merge pull request #1440 from x13machine/master
Pass token boolean to the listitem function.
2 parents 5ed5271 + 7de5376 commit 9fcb791

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

docs/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The following table lists the ticket type labels we use when there is work to be
2626
|:----------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
2727
|L0 - security |A security vulnerability within the Marked library is discovered. |
2828
|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. |
29-
|L2 - annoying |Similar to L1 - broken only there is a known workaround avaialable for the issue. |
29+
|L2 - annoying |Similar to L1 - broken only there is a known workaround available for the issue. |
3030
|RR - refactor and re-engineer |Results in an improvement to developers using Marked (improved readability) or end-users (faster performance) or both. |
3131
|NFS - new feature (spec related) |A capability Marked does not currently provide but is in one of the [supported specifications](#/README.md#specifications) |
3232
|NFU - new feature (user requested) |A capability Marked does not currently provide but has been requested by users of Marked. |

docs/USING_PRO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ console.log(myMarked('# heading+', { renderer: renderer }));
5151
- heading(*string* text, *number* level, *string* raw, *Slugger* slugger)
5252
- hr()
5353
- list(*string* body, *boolean* ordered, *number* start)
54-
- listitem(*string* text)
54+
- listitem(*string* text, *boolean* task, *boolean* checked)
5555
- checkbox(*boolean* checked)
5656
- paragraph(*string* text)
5757
- table(*string* header, *string* body)

lib/marked.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,18 +1258,19 @@ Parser.prototype.tok = function() {
12581258
case 'list_item_start': {
12591259
body = '';
12601260
var loose = this.token.loose;
1261+
var checked = this.token.checked;
1262+
var task = this.token.task;
12611263

12621264
if (this.token.task) {
1263-
body += this.renderer.checkbox(this.token.checked);
1265+
body += this.renderer.checkbox(checked);
12641266
}
12651267

12661268
while (this.next().type !== 'list_item_end') {
12671269
body += !loose && this.token.type === 'text'
12681270
? this.parseText()
12691271
: this.tok();
12701272
}
1271-
1272-
return this.renderer.listitem(body);
1273+
return this.renderer.listitem(body, task, checked);
12731274
}
12741275
case 'html': {
12751276
// TODO parse inline content if parameter markdown=1

0 commit comments

Comments
 (0)