Skip to content

Commit

Permalink
Revert handling of highlighted expr
Browse files Browse the repository at this point in the history
Part of #1307
  • Loading branch information
jayhesselberth committed Apr 24, 2020
1 parent e9fc93b commit c181e5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions R/highlight.r
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ highlight_text <- function(text) {
error = function(e) NULL
)

# Failed to parse
if (is.null(expr)) {
# Failed to parse, or yielded empty expression
if (length(expr) == 0) {
return(escape_html(text))
}

Expand Down
6 changes: 0 additions & 6 deletions tests/testthat/test-highlight.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,3 @@ test_that("unparsed code is still escaped", {
expect_equal(highlight_text("<"), "&lt;")
})

test_that("code consisting of comments only is not stripped of tags", {
scoped_package_context("test")

expect_equal(highlight_text("#"), "<span class='co'>#</span>")
})

0 comments on commit c181e5c

Please sign in to comment.