Fix task list checkbox toggle to work with YAML front matter (#25184) (#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>
This commit is contained in:
Giteabot 2023-06-13 04:23:21 -04:00 committed by GitHub
parent 506c70884a
commit c207b94e0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 66 additions and 7 deletions

View file

@ -20,6 +20,9 @@ type RenderConfig struct {
TOC string // "false": hide, "side"/empty: in sidebar, "main"/"true": in main view
Lang string
yamlNode *yaml.Node
// Used internally. Cannot be controlled by frontmatter.
metaLength int
}
func renderMetaModeFromString(s string) markup.RenderMetaMode {