Procházet zdrojové kódy

Enable gadget debug via options

regexplain.debug.gadget.(text|pattern|replacement)
tags/v0.2.0
Garrick Aden-Buie před 8 roky
rodič
revize
bb7e815eb3
1 změnil soubory, kde provedl 13 přidání a 0 odebrání
  1. +13
    -0
      R/regex_gadget.R

+ 13
- 0
R/regex_gadget.R Zobrazit soubor

@@ -162,6 +162,19 @@ regex_gadget <- function(text = NULL,
sanitize_text_input(input$pattern)
})

observe({
if (getOption('regexplain.debug.gadget.text', FALSE)) {
cat("\npattern: ", rtext())
}
if (getOption('regexplain.debug.gadget.pattern', FALSE)) {
cat("\npattern: ", pattern())
}
if (getOption('regexplain.debug.gadget.replacement', FALSE)) {
cat("\npattern: ", replacement())
}
cat("\n")
})

alert_result <- function(msg, type = "danger") {
msg <- gsub("\n", "<br>", msg)
msg <- gsub("\t", "&nbsp;&nbsp;", msg)

Načítá se…
Zrušit
Uložit