Skip to content

Commit

Permalink
Simplify testing for empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
wkmor1 committed May 20, 2020
1 parent 2513c80 commit 3936880
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/highlight.r
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ highlight_text <- function(text) {
)

# Failed to parse or is white-space only/empty
if (is.null(expr) || !nchar(trimws(text))) {
if (is.null(expr) || trimws(text) == "") {
return(escape_html(text))
}

Expand Down

0 comments on commit 3936880

Please sign in to comment.