Skip to content

Commit 4839688

Browse files
committed
Slight cleanup to reference docs; move safeLabel to internal
1 parent eb3cd7c commit 4839688

File tree

4 files changed

+34
-18
lines changed

4 files changed

+34
-18
lines changed

R/layers.R

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,6 @@ addPopups <- function(
395395
expandLimits(pts$lat, pts$lng)
396396
}
397397

398-
#' options for specify popup realted options
399398
#' @param className a CSS class name set on an element
400399
#' @param
401400
#' maxWidth,minWidth,maxHeight,autoPan,keepInView,closeButton,zoomAnimation,closeOnClick
@@ -437,8 +436,17 @@ clearPopups <- function(map) {
437436
invokeMethod(map, NULL, 'clearPopups')
438437
}
439438

440-
#' Helper Function to create a safe label
441-
#' @describeIn map-layers Create a label with sanitized text/html
439+
#' Sanitize textual labels
440+
#'
441+
#' This is a helper function used internally to HTML-escape user-provided
442+
#' labels. It prevents strings from unintentionally being treated as HTML when
443+
#' they are intended to be plaintext.
444+
#'
445+
#' @param label A vector or list of plain characters or HTML (marked by
446+
#' \code{\link[htmltools]{HTML}}), or a formula that resolves to such a value.
447+
#' @param data A data frame over which the formua is evaluated.
448+
#'
449+
#' @keywords internal
442450
#' @export
443451
safeLabel <- function(label, data) {
444452
if (is.null(label)) {
@@ -453,8 +461,6 @@ safeLabel <- function(label, data) {
453461
label
454462
}
455463

456-
#' Extra options for marker and polygon labels
457-
#'
458464
#' @param
459465
#' noHide,direction,offset,textsize,textOnly,style
460466
#' label options; see \url{https://github.com/Leaflet/Leaflet.label#options}

man/map-layers.Rd

Lines changed: 2 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/map-options.Rd

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/safeLabel.Rd

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)