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)