Skip to content

Commit a100b09

Browse files
committed
closes rstudio#119: we do not have to do this special treatment to the label for sliderInput, and no other inputs do as.character() for their labels
if users pass an HTML() object to the label argument, the HTML will be preserved instead of being escaped
1 parent b2d004c commit a100b09

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ shiny 0.8.0.99
122122
scientific notation when possible, e.g. 102145 is no longer rounded to
123123
1.0214e+05 = 102140. (Thanks, Martin Loos. #401)
124124

125+
* `sliderInput()` no longer treats a label wrapped in HTML() as plain text,
126+
e.g. the label in sliderInput(..., label = HTML('<em>A Label</em>')) will
127+
not be escaped any more. (#119)
128+
125129
shiny 0.8.0
126130
--------------------------------------------------------------------------------
127131

R/bootstrap.R

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -940,11 +940,6 @@ sliderInput <- function(inputId, label, min, max, value, step = NULL,
940940
round=FALSE, format='#,##0.#####', locale='us',
941941
ticks=TRUE, animate=FALSE) {
942942

943-
# validate label
944-
labelText <- as.character(label)
945-
if (!is.character(labelText))
946-
stop("label not specified")
947-
948943
if (identical(animate, TRUE))
949944
animate <- animationOptions()
950945

@@ -958,7 +953,7 @@ sliderInput <- function(inputId, label, min, max, value, step = NULL,
958953
# build slider
959954
tags$div(
960955
tagList(
961-
controlLabel(inputId, labelText),
956+
controlLabel(inputId, label),
962957
slider(inputId, min=min, max=max, value=value, step=step, round=round,
963958
locale=locale, format=format, ticks=ticks,
964959
animate=animate)

0 commit comments

Comments
 (0)