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

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

Closed
jtran opened this issue Jun 9, 2023 · 0 comments · Fixed by #25184
Closed

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

jtran opened this issue Jun 9, 2023 · 0 comments · Fixed by #25184

Comments

@jtran
Copy link
Contributor

jtran commented 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

@jtran jtran added the type/bug label Jun 9, 2023
lunny pushed a commit that referenced this issue Jun 13, 2023
Fixes #25160.

`data-source-position` of checkboxes in a task list was incorrect
whenever there was YAML front matter. This would result in issue content
or PR descriptions getting corrupted with random `x` or space characters
when a user checked or unchecked a task.
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Jun 13, 2023
…a#25184)

Fixes go-gitea#25160.

`data-source-position` of checkboxes in a task list was incorrect
whenever there was YAML front matter. This would result in issue content
or PR descriptions getting corrupted with random `x` or space characters
when a user checked or unchecked a task.
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Jun 13, 2023
…a#25184)

Fixes go-gitea#25160.

`data-source-position` of checkboxes in a task list was incorrect
whenever there was YAML front matter. This would result in issue content
or PR descriptions getting corrupted with random `x` or space characters
when a user checked or unchecked a task.
silverwind pushed a commit that referenced this issue Jun 13, 2023
…#25227)

Backport #25184 by @jtran

Fixes #25160.

`data-source-position` of checkboxes in a task list was incorrect
whenever there was YAML front matter. This would result in issue content
or PR descriptions getting corrupted with random `x` or space characters
when a user checked or unchecked a task.

Co-authored-by: Jonathan Tran <jon@allspice.io>
jtran added a commit to AllSpiceIO/gitea that referenced this issue Jun 13, 2023
…a#25184)

Fixes go-gitea#25160.

`data-source-position` of checkboxes in a task list was incorrect
whenever there was YAML front matter. This would result in issue content
or PR descriptions getting corrupted with random `x` or space characters
when a user checked or unchecked a task.
silverwind pushed a commit that referenced this issue Jun 13, 2023
…#25236)

Backport #25184 by @jtran
Closes #25225.

Fixes #25160.

`data-source-position` of checkboxes in a task list was incorrect
whenever there was YAML front matter. This would result in issue content
or PR descriptions getting corrupted with random `x` or space characters
when a user checked or unchecked a task.
Codeberg-org pushed a commit to Codeberg-org/gitea that referenced this issue Jun 23, 2023
…a#25184) (go-gitea#25236)

Backport go-gitea#25184 by @jtran
Closes go-gitea#25225.

Fixes go-gitea#25160.

`data-source-position` of checkboxes in a task list was incorrect
whenever there was YAML front matter. This would result in issue content
or PR descriptions getting corrupted with random `x` or space characters
when a user checked or unchecked a task.

(cherry picked from commit 1650a26)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2023
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.

2 participants