vpm: fix get_all_modules() (#14097)

master
Isaiah 2022-04-20 05:15:30 -04:00 committed by GitHub
parent 8cc79e4299
commit 0887b59254
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -584,17 +584,22 @@ fn get_all_modules() []string {
mut read_len := 0
mut modules := []string{}
for read_len < s.len {
mut start_token := '<a href="/mod'
mut start_token := "<a href='/mod"
end_token := '</a>'
// get the start index of the module entry
mut start_index := s.index_after(start_token, read_len)
if start_index == -1 {
break
start_token = '<a href="/mod'
start_index = s.index_after(start_token, read_len)
if start_index == -1 {
break
}
}
// get the index of the end of anchor (a) opening tag
// we use the previous start_index to make sure we are getting a module and not just a random 'a' tag
start_token = '">'
start_token = '>'
start_index = s.index_after(start_token, start_index) + start_token.len
// get the index of the end of module entry
end_index := s.index_after(end_token, start_index)
if end_index == -1 {