Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit aae4531

Browse files
author
Matthew Williams
committed
Fix link styling
1 parent 3d93242 commit aae4531

1 file changed

Lines changed: 4 additions & 20 deletions

File tree

claat/parser/md/parse.go

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -815,27 +815,11 @@ func button(ds *docState) types.Node {
815815
func link(ds *docState) types.Node {
816816
href := nodeAttr(ds.cur, "href")
817817

818-
text := stringifyNode(ds.cur, false)
819-
if strings.TrimSpace(text) == "" {
820-
return nil
821-
}
822-
823-
t := types.NewTextNode(text)
824-
if isBold(ds.cur.Parent) {
825-
t.Bold = true
826-
}
827-
if isItalic(ds.cur.Parent) {
828-
t.Italic = true
829-
}
830-
if isCode(ds.cur.Parent) {
831-
t.Code = true
832-
}
833-
if href == "" || href[0] == '#' {
834-
t.MutateBlock(findBlockParent(ds.cur))
835-
return t
836-
}
818+
ds.push(nil)
819+
parsedChildNodes := parseSubtree(ds)
820+
ds.pop()
837821

838-
n := types.NewURLNode(href, t)
822+
n := types.NewURLNode(href, parsedChildNodes...)
839823
n.Name = nodeAttr(ds.cur, "name")
840824
if v := nodeAttr(ds.cur, "target"); v != "" {
841825
n.Target = v

0 commit comments

Comments
 (0)