Skip to content

Commit

Permalink
Answer r cmd check issues
Browse files Browse the repository at this point in the history
  • Loading branch information
maksymiuks committed Sep 18, 2023
1 parent 8ca8494 commit ffc5389
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/map_rd2markdown.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ clean_text_whitespace <- function(x) {
#' @keywords internal
merge_text_whitespaces <- function(x) {
ws <- vapply(x, function(y) grepl("^ *$", y), FUN.VALUE = logical(1))
ib <- vapply(x, function(y) rd2markdown:::is_block(y), FUN.VALUE = logical(1))
ib <- vapply(x, function(y) is_block(y), FUN.VALUE = logical(1))
ws <- ws & !ib

seqs <- rle(ws)
Expand All @@ -150,7 +150,7 @@ merge_text_whitespaces <- function(x) {
merged <- append(merged, x_sub)
} else {
merged_ws <- paste0(x_sub, collapse = "")
if (isFALSE(values[i + 1]) && !rd2markdown:::is_block(x[[ws_inds + 1]])) {
if (isFALSE(values[i + 1]) && !is_block(x[[ws_inds + 1]])) {
merged_ws <- paste0(merged_ws, x[[ws_inds + 1]], collapse = "")
# We already include one of the next FALSE, therefore we reduce
# corresponding lengths value by 1 and increment current one
Expand All @@ -161,7 +161,7 @@ merge_text_whitespaces <- function(x) {
} else if (isFALSE(values[i - 1])) {
# Previous value was FALSE, therefore we can use last value in
# merged to append to unless it is block.
if (!rd2markdown:::is_block(merged[[length(merged)]])) {
if (!is_block(merged[[length(merged)]])) {
merged_ws <- paste0(merged[[length(merged)]], merged_ws, collapse = "")
merged[[length(merged)]] <- merged_ws
} else {
Expand Down
3 changes: 3 additions & 0 deletions R/rd2markdown.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ rd2markdown.title <- function(x, fragments = c(), ...) {

#' @param title optional section title
#' @param level optional level parameter. 2L by default
#' @param child_level optional parameter that will be set as level to
#' "child" tags parsed using `map_rd2markdown`. It allows proper rendering
#' of sections and subsections.
#'
#' @exportS3Method
#' @rdname rd2markdown
Expand Down
4 changes: 4 additions & 0 deletions man/rd2markdown.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ffc5389

Please sign in to comment.