summaryrefslogtreecommitdiffstats
path: root/modules/markup/markdown/callout/ast.go
blob: a5b1bbc2a028018ee6418118ade5d2d26156029f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2020 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package callout

import (
	"github.com/yuin/goldmark/ast"
)

// Attention is an inline for an attention
type Attention struct {
	ast.BaseInline
	AttentionType string
}

// Dump implements Node.Dump.
func (n *Attention) Dump(source []byte, level int) {
	m := map[string]string{}
	m["AttentionType"] = n.AttentionType
	ast.DumpHelper(n, source, level, m, nil)
}

// KindAttention is the NodeKind for Attention
var KindAttention = ast.NewNodeKind("Attention")

// Kind implements Node.Kind.
func (n *Attention) Kind() ast.NodeKind {
	return KindAttention
}

// NewAttention returns a new Attention node.
func NewAttention(attentionType string) *Attention {
	return &Attention{
		BaseInline:    ast.BaseInline{},
		AttentionType: attentionType,
	}
}