From 744c9d8f5a0a42f83ae360e8603b98fb5c24723a Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Thu, 12 Sep 2024 21:01:14 +0200 Subject: [PATCH] Fix constructor comments such that it does not concatenate return comment --- class.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/class.go b/class.go index 7beed9d..ee23314 100644 --- a/class.go +++ b/class.go @@ -185,10 +185,9 @@ func getConstructors(doc *goquery.Document) ([]Constructor, error) { resConstructor.Params[i].Comment = parameterDescription }) - constructorBlock.Find(":not(function)").Children().Each(func(i int, s *goquery.Selection) { - if s.Is("p") { - resConstructor.Comment = strings.TrimSpace(s.Text()) - } + constructorBlock.Find("div:not(.function):not(.indented) > p:not(:has(*))").Each(func(i int, s *goquery.Selection) { + resConstructor.Comment += strings.TrimSpace(s.Text()) + "\n" + resConstructor.Comment = strings.TrimSpace(resConstructor.Comment) }) spew.Dump(resConstructor)