Selaa lähdekoodia

Drop empty templates, show source, allow HTML in description

tags/v0.2.0
Garrick Aden-Buie 8 vuotta sitten
vanhempi
commit
84ca893558
1 muutettua tiedostoa jossa 8 lisäystä ja 5 poistoa
  1. +8
    -5
      R/regex_gadget.R

+ 8
- 5
R/regex_gadget.R Näytä tiedosto

@@ -250,14 +250,16 @@ regex_gadget <- function(text = NULL,

output$template_info <- renderUI({
req(this_template())
tt <- this_template()
rx_url <- "((https?|ftp|file)://)?([[:alnum:].-]+)\\.([a-zA-Z.]{2,6})([/[[:alpha:].-]*)*/?"
tagList(
tags$h5("Description"),
tags$p(this_template()$description),
tags$p(HTML(tt$description)),
tags$h5("Pattern"),
tags$pre(
tags$code(
this_template()$regex
)
tags$pre(tags$code(tt$regex)),
if (!is.null(tt$source)) tags$p(
"Source:",
if (grepl(rx_url, tt$source)) tags$a(href = tt$source, tt$source) else tt$source
)
)
})
@@ -846,5 +848,6 @@ get_templates <- function() {
simplifyDataFrame = FALSE,
simplifyMatrix = FALSE
)
patterns <- purrr::keep(patterns, ~ .$name != "")
patterns[order(purrr::map_chr(patterns, 'name'))]
}

Loading…
Peruuta
Tallenna