Skip to content

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

Closed
@jtran

Description

@jtran

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions