This commit is contained in:
2024-09-15 13:51:34 +02:00
parent 6ee7a4b2dc
commit 6836b35004

View File

@@ -179,7 +179,7 @@ func getClassName(dataContainer *goquery.Selection) (string, error) {
if class.Length() == 0 { if class.Length() == 0 {
return "", fmt.Errorf("no class found") return "", fmt.Errorf("no class found")
} }
res := strings.TrimSpace(class.Text()) res := CleanUp(class.Text())
return res, nil return res, nil
} }
@@ -216,8 +216,8 @@ func getConstructor(dataContainer *goquery.Selection) (Constructor, error) {
types.Each(func(i int, s *goquery.Selection) { types.Each(func(i int, s *goquery.Selection) {
resConstructor.Params = append(resConstructor.Params, Param{ resConstructor.Params = append(resConstructor.Params, Param{
Name: strings.TrimSpace(params.Eq(i).Text()), Name: CleanUp(params.Eq(i).Text()),
Type: MapType(strings.TrimSpace(types.Eq(i).Text())), Type: MapType(CleanUp(types.Eq(i).Text())),
Comment: "", Comment: "",
}) })
}) })
@@ -240,7 +240,7 @@ func getConstructor(dataContainer *goquery.Selection) (Constructor, error) {
// So we just ignore it // So we just ignore it
return return
} }
text := strings.TrimSpace(s.Text()) text := CleanUp(s.Text())
if text == "" { if text == "" {
return return
} }
@@ -259,7 +259,7 @@ func getConstructor(dataContainer *goquery.Selection) (Constructor, error) {
return return
case 1: case 1:
param := s.ChildrenFiltered("span.parameter").Text() param := s.ChildrenFiltered("span.parameter").Text()
paramTrimmed := strings.TrimSpace(param) paramTrimmed := CleanUp(param)
for i := range resConstructor.Params { for i := range resConstructor.Params {
cparam := &resConstructor.Params[i] cparam := &resConstructor.Params[i]
if paramTrimmed == cparam.Name { if paramTrimmed == cparam.Name {
@@ -346,7 +346,7 @@ func parseMethod(s *goquery.Selection) (Method, error) {
parameters := s.Find("span.parameter") parameters := s.Find("span.parameter")
types.Each(func(i int, s *goquery.Selection) { types.Each(func(i int, s *goquery.Selection) {
res.Params = append(res.Params, Param{ res.Params = append(res.Params, Param{
Name: CleanUp(parameters.Eq(i).Text()), Name: MapName(CleanUp(parameters.Eq(i).Text())),
Type: MapType(CleanUp(types.Eq(i).Text())), Type: MapType(CleanUp(types.Eq(i).Text())),
Comment: "", Comment: "",
}) })