Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown checkboxes rendered badly #17395

Closed
noerw opened this issue Oct 21, 2021 · 2 comments · Fixed by #17411
Closed

Markdown checkboxes rendered badly #17395

noerw opened this issue Oct 21, 2021 · 2 comments · Fixed by #17411

Comments

@noerw
Copy link
Member

noerw commented Oct 21, 2021

Gitea Version

1.15.4 + 58cd55d (recent 1.16)

Git Version

No response

Operating System

No response

How are you running Gitea?

gitea.com

Database

No response

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Description

Spaced lists render badly, see screenshot.

Reproducer:

#### dense list
- [ ] foo
- [ ] barbarbarbarbarbarbarbar barbarbarbarbarbarbarbar barbarbarbarbarbarbarbar barbarbarbarbarbarbar barbarbarbarbar
- [ ] baz

#### not so dense list
- [ ] foo

- [ ] barbarbarbarbarbarbarbar barbarbarbarbarbarbarbar barbarbarbarbarbarbarbar barbarbarbarbarbarbar barbarbarbarbar

- [ ] baz

Screenshots

image

@silverwind
Copy link
Member

GH rendering for comparison:

dense list

  • foo
  • barbarbarbarbarbarbarbar barbarbarbarbarbarbarbar barbarbarbarbarbarbarbar barbarbarbarbarbarbar barbarbarbarbar
  • baz

not so dense list

  • foo

  • barbarbarbarbarbarbarbar barbarbarbarbarbarbarbar barbarbarbarbarbarbarbar barbarbarbarbarbarbar barbarbarbarbar

  • baz

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Oct 23, 2021

It can be fixed by this patch.

.markup .task-list-item {
    list-style-type: none;
    position: relative; /* add this */
}
.markup .task-list-item input[type=checkbox] {
   /* before:  margin: 0 6px 0.25em -1.6em;
      replace with below:
  */
    position: absolute;
    top: 0.25em;
    left: -1.6em;
}

image

@wxiaoguang wxiaoguang linked a pull request Oct 23, 2021 that will close this issue
wxiaoguang added a commit to wxiaoguang/gitea that referenced this issue Oct 23, 2021
* Bug fix: render Markdown http://AppURL/org/repo/issues/4?a=1&b=2#comment-123 test to HTML correctly, close go-gitea#17394
* Bug fix: fix the positions of checkboxes in rendered HTML, close go-gitea#17395
wxiaoguang added a commit that referenced this issue Oct 23, 2021
* Bug fix: render Markdown http://AppURL/org/repo/issues/4?a=1&b=2#comment-123 test to HTML correctly, close #17394
* Bug fix: fix the positions of checkboxes in rendered HTML, close #17395
wxiaoguang added a commit to wxiaoguang/gitea that referenced this issue Oct 23, 2021
* Bug fix: render Markdown `http://AppURL/org/repo/issues/4?a=1&b=2#comment-123 test` to HTML correctly, close go-gitea#17394
* Bug fix: fix the positions of checkboxes in rendered HTML, close go-gitea#17395

# Conflicts:
#	modules/markup/html.go
lunny pushed a commit that referenced this issue Oct 23, 2021
* Bug fix: render Markdown `http://AppURL/org/repo/issues/4?a=1&b=2#comment-123 test` to HTML correctly, close #17394
* Bug fix: fix the positions of checkboxes in rendered HTML, close #17395

# Conflicts:
#	modules/markup/html.go
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
* Bug fix: render Markdown http://AppURL/org/repo/issues/4?a=1&b=2#comment-123 test to HTML correctly, close go-gitea#17394
* Bug fix: fix the positions of checkboxes in rendered HTML, close go-gitea#17395
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants