added tasklist extra and unit test by liguangsheng · Pull Request #218 · trentm/python-markdown2
added tasklist extra and unit test.
See Issue #216
This was referenced
Jun 24, 2016| (.*) # list item text = \2 | ||
| ''', re.M | re.X | re.S) | ||
|
|
||
| _task_list_warpper_str = r'<p><input type="checkbox" class="task-list-item-checkbox" %sdisabled>%s</p>' |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, the <p> tag is unnecessary.
We can also have a look at github flavour markdown parser result
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" checked="" disabled=""> text body </li>
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look into this.
| def _task_list_item_sub(self, match): | ||
| marker = match.group(1) | ||
| item_text = match.group(2) | ||
| if marker == '[x]': |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should also take into account the situation where an uppercase X is used since Github markdown also accepts that.
For e.g.
- this is marked
- this is also marked
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters