trentm / trentm/python-markdown2

Added extra 'task_list' option, the html does not preform like github.

Open
#321 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Feature
Dominant language
Python
Stars
2.8k
Forks
459
Avg merge
2d 19h
Merged PRs (30d)
4

Description

I add 'task_list' option, and the html performed like this:

    • task list item
      but the github task list item performed like this:
  • task list item
    never mind that I used the wrong markdown syntax to show the result, for I can not insert the image.
    I found the html converted by markdown2 is like blow:
<li><p><input type="checkbox" class="task-list-item-checkbox" %sdisabled>%s</p></li>

and it will be format with the "checked" status and the real text after "- [ ]" or "- [x]", but the above html code can not performed like github, because the task list items at github do not have the list leader, while the list items of above html will have.
I want to make it perform like github, but the generate rule does not leave me any space to make me write the class selector to modify the performance of the items of task list. So I think why not change the generate style to make it performed like github like below:

 return "<li class='task-list-item'>%s</li>\n" % item
//line 1689 at markdown2.py 

So I can write class selector to make it perform like github.

.markdown-body .task-list-item {
  list-style-type: none;
}

or change like blow:

 return "<li style='list-style-type: none;'>%s</li>\n" % item

No need to write CSS handly.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at markdown2.py around line 1689 and inspect the task_list HTML generation and nearby tests or examples. Compare the generated task-list markup with GitHub's behavior; done means unchecked and checked items render without the unwanted list marker while preserving their text and checkbox state.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
frontend, web-dev
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.