Skip to content

Commit

Permalink
fix: prev directory fix
Browse files Browse the repository at this point in the history
  • Loading branch information
riza committed Jul 5, 2024
1 parent 83d72e6 commit 7b93793
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Usage of indextree:
(_)___ ____/ /__ _ __/ /_________ ___
/ / __ \/ __ / _ \| |/_/ __/ ___/ _ \/ _ \
/ / / / / /_/ / __/> </ /_/ / / __/ __/
/_/_/ /_/\__,_/\___/_/|_|\__/_/ \___/\___/ v1.0.0
/_/_/ /_/\__,_/\___/_/|_|\__/_/ \___/\___/ v1.0.5

├── http://127.0.0.1/HOME/
├── http://127.0.0.1/secrets/
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (
/_/_/ /_/\__,_/\___/_/|_|\__/_/ \___/\___/ %s
`
version = `v1.0.4`
version = `v1.0.5`

treeBranch = `├── `
treeEnd = `└── `
Expand Down Expand Up @@ -220,7 +220,7 @@ func parseIndex(body io.Reader) ([]string, error) {
doc.Find("a").Each(func(i int, s *goquery.Selection) {
//skip parent directory
href, _ := s.Attr("href")
if strings.HasPrefix(href, "?") || href == "../" || href == "/" || strings.Contains(strings.ToLower(s.Text()), "parent") { // parent directory
if strings.Contains(href, "/../") || strings.HasPrefix(href, "?") || href == "../" || href == "/" || strings.Contains(strings.ToLower(s.Text()), "parent") { // parent directory
return
}

Expand Down

0 comments on commit 7b93793

Please sign in to comment.