@@ -1092,7 +1092,7 @@ paginate_to_mpfs <- function(obj,
1092
1092
return (mpfs )
1093
1093
}
1094
1094
1095
- if (! is.null(page_num ) && (length(prov_footer( obj )) == 0 || ! any(grepl( page_num , prov_footer( obj ), fixed = TRUE ))) ) {
1095
+ if (! is.null(page_num )) {
1096
1096
# Only adding a line for pagination -> lpp - 1 would have worked too
1097
1097
prov_footer(obj ) <- c(prov_footer(obj ), page_num )
1098
1098
}
@@ -1149,7 +1149,7 @@ paginate_to_mpfs <- function(obj,
1149
1149
col_gap = col_gap
1150
1150
)
1151
1151
}
1152
- # # this MUST alsways return a list, inluding list(obj) when
1152
+ # # this MUST always return a list, including list(obj) when
1153
1153
# # no forced pagination is needed! otherwise stuff breaks for things
1154
1154
# # based on s3 classes that are lists underneath!!!
1155
1155
fpags <- do_forced_paginate(obj )
@@ -1161,16 +1161,21 @@ paginate_to_mpfs <- function(obj,
1161
1161
# # but we will if we ever allow force_paginate to do horiz
1162
1162
# # pagination.
1163
1163
if (length(fpags ) > 1 ) {
1164
- deep_pag <- lapply(
1165
- fpags , paginate_to_mpfs ,
1164
+ # Correction for case we are entering here (page_by?)
1165
+ if (! is.null(page_num )) {
1166
+ prov_footer(obj ) <- head(prov_footer(obj ), - 1 )
1167
+ fpags <- do_forced_paginate(obj )
1168
+ }
1169
+ deep_pag <- paginate_to_mpfs( # what about the other parameters?
1170
+ fpags ,
1166
1171
pg_size_spec = pg_size_spec ,
1167
1172
colwidths = colwidths ,
1168
1173
min_siblings = min_siblings ,
1169
1174
nosplitin = nosplitin ,
1170
1175
verbose = verbose ,
1171
1176
page_num = page_num
1172
1177
)
1173
- return (unlist( deep_pag , recursive = FALSE ) )
1178
+ return (deep_pag )
1174
1179
} else if (has_page_title(fpags [[1 ]])) {
1175
1180
obj <- fpags [[1 ]]
1176
1181
}
0 commit comments