wrMisc (version 1.14.2)

htmlSpecCharConv: Html special character conversion

Description

Converts 'txt' so that (the most common) special characters (like 'beta','micro','square' etc) will be displayed correctly whe used for display in html (eg at mouse-over). Note : The package stringi is required for the conversions (the input will get returned if stringi is not available). Currently only the 16 most common special characters are implemented.

Usage

htmlSpecCharConv(txt, silent = FALSE, callFrom = NULL, debug = FALSE)

Value

This function returns a corrected character vector adopted for html display

Arguments

txt

character vector, including special characters

silent

(logical) suppress messages

callFrom

(character) allow easier tracking of messages produced

debug

(logical) additional messages for debugging

See Also

Examples

Run this code
## we'll use the package stringi to generate text including the 'micro'-symbol as input
x <- if(requireNamespace("stringi", quietly=TRUE)) {
  stringi::stri_unescape_unicode("\\u00b5\\u003d\\u0061\\u0062")} else "\"x=axb\""
htmlSpecCharConv(x)

Run the code above in your browser using DataLab