diff options
author | 2022-12-16 11:20:22 +0000 | |
---|---|---|
committer | 2022-12-16 12:20:22 +0100 | |
commit | eb08529f35ce33ed98c34fb48013f0f4a5fc9635 (patch) | |
tree | 394fd774a943f5c33ce793c67b5865f2570b46c5 /vendor/github.com/yuin/goldmark/extension/ast/tasklist.go | |
parent | [bugfix] use match-sorter for filtering domain blocks (#1270) (diff) | |
download | gotosocial-eb08529f35ce33ed98c34fb48013f0f4a5fc9635.tar.xz |
[chore/bugfix] Switch markdown from blackfriday to goldmark (#1267)
Co-authored-by: Autumn! <autumnull@posteo.net>
Diffstat (limited to 'vendor/github.com/yuin/goldmark/extension/ast/tasklist.go')
-rw-r--r-- | vendor/github.com/yuin/goldmark/extension/ast/tasklist.go | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/vendor/github.com/yuin/goldmark/extension/ast/tasklist.go b/vendor/github.com/yuin/goldmark/extension/ast/tasklist.go new file mode 100644 index 000000000..670cc1495 --- /dev/null +++ b/vendor/github.com/yuin/goldmark/extension/ast/tasklist.go @@ -0,0 +1,35 @@ +package ast + +import ( + "fmt" + gast "github.com/yuin/goldmark/ast" +) + +// A TaskCheckBox struct represents a checkbox of a task list. +type TaskCheckBox struct { + gast.BaseInline + IsChecked bool +} + +// Dump implements Node.Dump. +func (n *TaskCheckBox) Dump(source []byte, level int) { + m := map[string]string{ + "Checked": fmt.Sprintf("%v", n.IsChecked), + } + gast.DumpHelper(n, source, level, m, nil) +} + +// KindTaskCheckBox is a NodeKind of the TaskCheckBox node. +var KindTaskCheckBox = gast.NewNodeKind("TaskCheckBox") + +// Kind implements Node.Kind. +func (n *TaskCheckBox) Kind() gast.NodeKind { + return KindTaskCheckBox +} + +// NewTaskCheckBox returns a new TaskCheckBox node. +func NewTaskCheckBox(checked bool) *TaskCheckBox { + return &TaskCheckBox{ + IsChecked: checked, + } +} |