Fix constructor comments such that it does not concatenate return comment

This commit is contained in:
2024-09-12 21:01:14 +02:00
parent a069e0eb98
commit 744c9d8f5a

View File

@@ -185,10 +185,9 @@ func getConstructors(doc *goquery.Document) ([]Constructor, error) {
resConstructor.Params[i].Comment = parameterDescription resConstructor.Params[i].Comment = parameterDescription
}) })
constructorBlock.Find(":not(function)").Children().Each(func(i int, s *goquery.Selection) { constructorBlock.Find("div:not(.function):not(.indented) > p:not(:has(*))").Each(func(i int, s *goquery.Selection) {
if s.Is("p") { resConstructor.Comment += strings.TrimSpace(s.Text()) + "\n"
resConstructor.Comment = strings.TrimSpace(s.Text()) resConstructor.Comment = strings.TrimSpace(resConstructor.Comment)
}
}) })
spew.Dump(resConstructor) spew.Dump(resConstructor)