@@ -361,7 +361,7 @@ process_srrstats_tags <- function (tag = "srrstats", block,
361361
362362 standards <- roxygen2 :: block_get_tags (block , tag )
363363 standards <- unlist (lapply (standards , function (i ) i $ val ))
364- snum <- extract_standard_numbers (standards )
364+ snum <- extract_standard_numbers (standards , block )
365365
366366 standards_txt <- vapply (seq_along (snum ), function (i ) {
367367 gsub (paste0 (" ^.*" , snum [i ], " \\ }" ), " " , standards [i ])
@@ -405,7 +405,7 @@ process_srrstats_tags <- function (tag = "srrstats", block,
405405
406406# extract the actual standards numbers from arbitrary text strings, first
407407# capturing everything inside first "[...]":
408- extract_standard_numbers <- function (standards ) {
408+ extract_standard_numbers <- function (standards , block ) {
409409
410410 # roxygen parses markdown "**A**" as "\\strong{A}", and the curly braces
411411 # muck up standards ID, so have to be removed here:
@@ -428,7 +428,9 @@ extract_standard_numbers <- function (standards) {
428428 standards <- gsub (" \\ {|\\ }" , " " , substring (standards , g_open , g_close ))
429429 standards <- gsub (" \\ s*" , " " , unlist (strsplit (standards , " ," )))
430430 if (length (standards ) < 1 ) {
431- stop (" srrstats tags found but no correctly-formatted standard numbers" )
431+ cli :: cli_abort (
432+ " srrstats tags in {block$file} line {block$line} have incorrectly-formatted standard numbers"
433+ )
432434 }
433435
434436 return (standards )
0 commit comments