Skip to content

Commit 2f3337a

Browse files
exclude new lines in test string half slash
1 parent 23c20b5 commit 2f3337a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

r_regex_tester/global.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ highlight_color_pallete = "Set3"
3232
mgsub = function(pattern, replacement, text.var, leadspace = FALSE,
3333
trailspace = FALSE, fixed = TRUE, trim = TRUE,
3434
order.pattern = fixed, ...) {
35-
#' @description I wanted qdap::mgsub() w/o having to have full qdap package,
36-
#' which has had issues deploying around rJava i think...
35+
#' @description I wanted qdap::mgsub() w/o having to have full qdap package.
36+
#' qdap has had issues related to deploying a shinyapp.
3737

3838
if (leadspace | trailspace)
3939
replacement = spaste(replacement,

r_regex_tester/server.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ shinyServer(function(input, output, session) {
66
is.null(safe_slashes(input$pattern))
77
) | (
88
!("test_str" %in% input$auto_escape_check_group) &
9-
is.null(safe_slashes(input$test_str))
9+
is.null(safe_slashes(input$test_str, exclude = c("\\n")))
1010
)
1111
})
1212

@@ -25,7 +25,7 @@ shinyServer(function(input, output, session) {
2525

2626
test_str = ifelse("test_str" %in% input$auto_escape_check_group,
2727
input$test_str,
28-
safe_slashes(input$test_str))
28+
safe_slashes(input$test_str, exclude = c("\\n")))
2929

3030
test_str
3131
})
@@ -57,6 +57,8 @@ shinyServer(function(input, output, session) {
5757
fixed_log,
5858
color_palette = highlight_color_pallete
5959
)
60+
61+
out = gsub("\n", "<br>", out)
6062

6163
if (is.null(out)) {
6264
HTML("")

0 commit comments

Comments
 (0)