fix #newpage issues
This commit is contained in:
parent
add69c5c81
commit
559283566b
@ -74,6 +74,11 @@ func (this *ArchiveState) renderView(w http.ResponseWriter) {
|
||||
|
||||
lines := strings.Split(string(fc), "\n")
|
||||
|
||||
// Work around #newpage: if the last line is blank, skip
|
||||
if len(lines) > 0 && len(lines[len(lines)-1]) == 0 {
|
||||
lines = lines[:len(lines)-1]
|
||||
}
|
||||
|
||||
this.highestPage = int(math.Ceil(float64(len(lines))/float64(this.svr.cfg.LinesPerPage))) - 1
|
||||
if this.page == pageNotSet || this.page > this.highestPage {
|
||||
this.page = this.highestPage
|
||||
|
Loading…
Reference in New Issue
Block a user