Toggling checkbox in task list corrupts markdown when there's YAML front matter #10996

Closed
opened 2025-11-02 09:24:21 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @jtran on GitHub (Jun 9, 2023).

Description

Steps to reproduce:

  1. Go to New Issue page
  2. Fill in a title, and for content, fill in both YAML front matter and a task list, such as the below:
---
foo: bar
---
- [ ] checkbox
  1. Click "Create Issue"
  2. Once the issue is created, a checkbox is rendered. Click the checkbox to make it checked.
  3. Reload the page

I expected the checkbox to be checked and all other text including front matter to be the same as was originally entered.

Instead, a seemingly random character in the middle of the front matter or other markdown text content, depending on character positions, is replaced by an x character. Unchecking will replace the character with a space character. The problem has also been observed in pull request descriptions.

Demo: https://try.gitea.io/shravya/testing/issues/1

Gitea Version

1.20.0+rc0-12-g63a429581

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Screenshot 2023-06-08 at 8 05 33 PM

Git Version

No response

Operating System

No response

How are you running Gitea?

Using try.gitea.io.

Database

None

Originally created by @jtran on GitHub (Jun 9, 2023). ### Description Steps to reproduce: 1. Go to New Issue page 2. Fill in a title, and for content, fill in both YAML front matter and a task list, such as the below: ``` --- foo: bar --- - [ ] checkbox ``` 3. Click "Create Issue" 4. Once the issue is created, a checkbox is rendered. Click the checkbox to make it checked. 5. Reload the page I expected the checkbox to be checked and all other text including front matter to be the same as was originally entered. Instead, a seemingly random character in the middle of the front matter or other markdown text content, depending on character positions, is replaced by an `x` character. Unchecking will replace the character with a space character. The problem has also been observed in pull request descriptions. Demo: https://try.gitea.io/shravya/testing/issues/1 ### Gitea Version 1.20.0+rc0-12-g63a429581 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots <img width="921" alt="Screenshot 2023-06-08 at 8 05 33 PM" src="https://github.com/go-gitea/gitea/assets/10803/0fcde0f0-04e6-4f84-9968-380949ad6d76"> ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Using try.gitea.io. ### Database None
GiteaMirror added the outdated/theme/markdowntype/bug labels 2025-11-02 09:24:21 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10996