Skip to content

Commit

Permalink
Fix markdown checkbox rendering (#17427)
Browse files Browse the repository at this point in the history
We allow to render empty check list item - [ ], while GitHub doesn't allow.

To make the rendering correct, we need tune the UI (the last PR #17413 uses absolute layout, which makes the empty checkbox item can not be displayed correctly)
  • Loading branch information
wxiaoguang authored Oct 25, 2021
1 parent 175ebc6 commit 06da10b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web_src/less/markup/content.less
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,18 @@
.task-list-item {
list-style-type: none;
position: relative;
line-height: 1.5rem;
min-height: 1.5rem; // to render a checkbox list without content `- [ ]`, we need this min-height to make sure the <li> can be visible

input[type="checkbox"] {
position: absolute;
top: .25em;
left: -1.6em;
}

p {
line-height: 1.5rem;
}
}

.task-list-item + .task-list-item {
Expand Down

0 comments on commit 06da10b

Please sign in to comment.