From 7cc53b65bbffeea7fdfd5721d37403b2f19ba138 Mon Sep 17 00:00:00 2001 From: rhysd Date: Tue, 13 Feb 2024 03:09:06 +0900 Subject: [PATCH] Add `AutoLink.LabelSegment` method --- ast/inline.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ast/inline.go b/ast/inline.go index 7e4c51f..02711de 100644 --- a/ast/inline.go +++ b/ast/inline.go @@ -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{