mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
Add AutoLink.LabelSegment method
This commit is contained in:
parent
848dc66530
commit
7cc53b65bb
1 changed files with 5 additions and 0 deletions
|
|
@ -503,6 +503,11 @@ func (n *AutoLink) Label(source []byte) []byte {
|
|||
return n.value.Text(source)
|
||||
}
|
||||
|
||||
// LabelSegment returns a source position of label text in a source text.
|
||||
func (n *AutoLink) LabelSegment() textm.Segment {
|
||||
return n.value.Segment
|
||||
}
|
||||
|
||||
// NewAutoLink returns a new AutoLink node.
|
||||
func NewAutoLink(typ AutoLinkType, value *Text) *AutoLink {
|
||||
return &AutoLink{
|
||||
|
|
|
|||
Loading…
Reference in a new issue