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

Completely fix task-list checkbox styling #10798

Merged
merged 2 commits into from
Mar 22, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Completely fix task-list checkbox styling
  • Loading branch information
zeripath committed Mar 22, 2020
commit db787c3035fe98f8c7addf935000e198ceffe306
6 changes: 6 additions & 0 deletions modules/markup/markdown/goldmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ func (g *GiteaASTTransformer) Transform(node *ast.Document, reader text.Reader,
link = []byte("#user-content-" + string(link)[1:])
}
v.Destination = link
case *ast.List:
if v.HasChildren() && v.FirstChild().HasChildren() && v.FirstChild().FirstChild().HasChildren() {
if _, ok := v.FirstChild().FirstChild().FirstChild().(*east.TaskCheckBox); ok {
v.SetAttribute([]byte("class"), []byte("task-list"))
}
}
}
return ast.WalkContinue, nil
})
Expand Down