Skip to content

Commit fff978c

Browse files
committed
fix: refine hidden comments detection in rtoqmd function
1 parent d499248 commit fff978c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

R/rtoqmd.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,10 @@ rtoqmd <- function(input_file, output_file = NULL,
406406
if (i %in% metadata_lines) {
407407
# Ignore metadata lines - do nothing
408408

409-
# Skip hidden comments (# without space after)
410-
} else if (grepl("^#[^' |]", line)) {
409+
# Skip hidden comments (# without space after, but not multiple #)
410+
} else if (grepl("^#[^# '|]", line)) {
411411
# Ignore comments without space after # (e.g., #NOTE:, #TODO:, #DEBUG)
412-
# But allow #' (roxygen), # (space), and #| (chunk options) to pass through
412+
# But allow ## (section titles), #' (roxygen), # (space), and #| (chunk options) to pass through
413413

414414
# Process roxygen2 documentation blocks
415415
} else if (grepl("^#'", line)) {

0 commit comments

Comments
 (0)