Cleanup
This commit is contained in:
12
class.go
12
class.go
@@ -179,7 +179,7 @@ func getClassName(dataContainer *goquery.Selection) (string, error) {
|
||||
if class.Length() == 0 {
|
||||
return "", fmt.Errorf("no class found")
|
||||
}
|
||||
res := strings.TrimSpace(class.Text())
|
||||
res := CleanUp(class.Text())
|
||||
return res, nil
|
||||
}
|
||||
|
||||
@@ -216,8 +216,8 @@ func getConstructor(dataContainer *goquery.Selection) (Constructor, error) {
|
||||
|
||||
types.Each(func(i int, s *goquery.Selection) {
|
||||
resConstructor.Params = append(resConstructor.Params, Param{
|
||||
Name: strings.TrimSpace(params.Eq(i).Text()),
|
||||
Type: MapType(strings.TrimSpace(types.Eq(i).Text())),
|
||||
Name: CleanUp(params.Eq(i).Text()),
|
||||
Type: MapType(CleanUp(types.Eq(i).Text())),
|
||||
Comment: "",
|
||||
})
|
||||
})
|
||||
@@ -240,7 +240,7 @@ func getConstructor(dataContainer *goquery.Selection) (Constructor, error) {
|
||||
// So we just ignore it
|
||||
return
|
||||
}
|
||||
text := strings.TrimSpace(s.Text())
|
||||
text := CleanUp(s.Text())
|
||||
if text == "" {
|
||||
return
|
||||
}
|
||||
@@ -259,7 +259,7 @@ func getConstructor(dataContainer *goquery.Selection) (Constructor, error) {
|
||||
return
|
||||
case 1:
|
||||
param := s.ChildrenFiltered("span.parameter").Text()
|
||||
paramTrimmed := strings.TrimSpace(param)
|
||||
paramTrimmed := CleanUp(param)
|
||||
for i := range resConstructor.Params {
|
||||
cparam := &resConstructor.Params[i]
|
||||
if paramTrimmed == cparam.Name {
|
||||
@@ -346,7 +346,7 @@ func parseMethod(s *goquery.Selection) (Method, error) {
|
||||
parameters := s.Find("span.parameter")
|
||||
types.Each(func(i int, s *goquery.Selection) {
|
||||
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())),
|
||||
Comment: "",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user