diff --git a/R/PRISMA_flowdiagram.R b/R/PRISMA_flowdiagram.R index 94cc2c8..40fb89b 100755 --- a/R/PRISMA_flowdiagram.R +++ b/R/PRISMA_flowdiagram.R @@ -1447,7 +1447,7 @@ PRISMA_data <- function(data) { #nolint ) dbr_excluded <- data.frame( reason = gsub( - ",\\s*\\d+\\s*$", + ",.*$", "", unlist( strsplit( @@ -1464,8 +1464,8 @@ PRISMA_data <- function(data) { #nolint ) ), n = gsub( - "^.*,\\s*(\\d+)\\s*$", - "\\1", + ".*,", + "", unlist( strsplit( as.character( @@ -1493,7 +1493,7 @@ PRISMA_data <- function(data) { #nolint ) other_excluded <- data.frame( reason = gsub( - ",\\s*\\d+\\s*$", + ",.*$", "", unlist( strsplit( @@ -1510,8 +1510,8 @@ PRISMA_data <- function(data) { #nolint ) ), n = gsub( - "^.*,\\s*(\\d+)\\s*$", - "\\1", + ".*,", + "", unlist( strsplit( as.character( diff --git a/R/utils.R b/R/utils.R index 2a0ff59..25aea36 100644 --- a/R/utils.R +++ b/R/utils.R @@ -5,10 +5,9 @@ PRISMA_escape_text_ <- function(text) { #nolint if (is.null(text)) return(text) text <- as.character(text) - # Escape backslashes first, then quotes and apostrophes - text <- gsub("\\", "\\\\", text, fixed = TRUE) + # Escape double quotes and apostrophes for DOT syntax text <- gsub('"', '\\"', text, fixed = TRUE) - text <- gsub("'", "\\'", text, fixed = TRUE) + text <- gsub("'", "'", text, fixed = TRUE) return(text) }