Skip to content

Commit

Permalink
Keep functional notation.
Browse files Browse the repository at this point in the history
  • Loading branch information
SebKrantz committed Jun 1, 2024
1 parent fb5aace commit 1081f7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/highlight.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ highlight_text <- function(text) {
text <- gsub("[(", "`[`(", text, fixed = TRUE)
text <- gsub("$(", "`$`(", text, fixed = TRUE)
out <- downlit::highlight(text, classes = downlit::classes_pandoc())
out <- gsub("<span class='fu'>`[[`</span>", "<span class='fu'>[[</span>", out, fixed = TRUE)
out <- gsub("<span class='fu'>`[`</span>", "<span class='fu'>[</span>", out, fixed = TRUE)
out <- gsub("<span class='fu'>`$`</span>", "<span class='fu'>$</span>", out, fixed = TRUE)
# out <- gsub("<span class='fu'>`[[`</span>", "<span class='fu'>[[</span>", out, fixed = TRUE)
# out <- gsub("<span class='fu'>`[`</span>", "<span class='fu'>[</span>", out, fixed = TRUE)
# out <- gsub("<span class='fu'>`$`</span>", "<span class='fu'>$</span>", out, fixed = TRUE)
if (!is.na(out)) {
sourceCode(pre(out, r_code = TRUE))
} else {
Expand Down

0 comments on commit 1081f7b

Please sign in to comment.